Skip to content

Use dedicated JMS listener connection factory#49833

Open
arnabnandy7 wants to merge 4 commits into
Azure:mainfrom
arnabnandy7:feature/jms-dual-factories
Open

Use dedicated JMS listener connection factory#49833
arnabnandy7 wants to merge 4 commits into
Azure:mainfrom
arnabnandy7:feature/jms-dual-factories

Conversation

@arnabnandy7

Copy link
Copy Markdown
Contributor

Description

Fixes the Service Bus JMS connection factory configuration so applications can use:

  • JmsPoolConnectionFactory for sending messages.
  • ServiceBusJmsConnectionFactory for listener containers.

This combination is selected by configuring:

spring.jms.servicebus.pool.enabled=true
spring.jms.cache.enabled=false

Previously, this property combination caused both the sender and listener containers to use JmsPoolConnectionFactory. This prevented Standard-tier Service Bus topic subscriptions from using the native ServiceBusJmsConnectionFactory.
The listener connection factory decision table now selects a dedicated ServiceBusJmsConnectionFactory for this combination, while the sender continues to use JmsPoolConnectionFactory.

The change includes tests for both Standard and Premium Service Bus tiers. The tests verify that queue and topic listener containers share the dedicated native connection factory and do not use the pooled sender connection factory.
The corresponding connection factory tables in the CHANGELOG have also been updated.

Fixes: #49308

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Copilot AI review requested due to automatic review settings July 15, 2026 23:00
@arnabnandy7
arnabnandy7 requested review from a team, moarychan, rujche and saragluna as code owners July 15, 2026 23:00
@github-actions github-actions Bot added azure-spring All azure-spring related issues Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution @arnabnandy7! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
32 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Service Bus JMS auto-configuration so that when spring.jms.servicebus.pool.enabled=true and spring.jms.cache.enabled=false, the sender continues to use JmsPoolConnectionFactory while listener containers use a dedicated native ServiceBusJmsConnectionFactory (enabling Standard-tier topic subscriptions).

Changes:

  • Updated the listener-container connection factory decision table to select ServiceBusJmsConnectionFactory for pool=true + cache=false.
  • Added an auto-configuration test covering the pool=true + cache=false case across Standard and Premium tiers.
  • Updated the Spring module CHANGELOG connection-factory tables to reflect the corrected behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/jms/ServiceBusJmsAutoConfigurationTests.java Adds a new parameterized test verifying listener containers use a native/dedicated connection factory when pooling is enabled and caching is disabled.
sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/jms/ServiceBusJmsContainerConfiguration.java Adjusts the listener container decision table so pool=true + cache=false yields ServiceBusJmsConnectionFactory.
sdk/spring/CHANGELOG.md Updates the documented decision tables to match the new listener container behavior.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread sdk/spring/CHANGELOG.md Outdated
Comment thread sdk/spring/CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] JMS - [JMS] No property combination yields sender=JmsPoolConnectionFactory + listener=ServiceBusJmsConnectionFactory

2 participants