- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.1k
 
Spring Cloud Azure Service Bus Spring Jms Support Design
For Spring Jms support for service bus, we provide the package of spring-cloud-azure-starter-servicebus-jms  and jms module in the package of spring-cloud-azure-auto-configure.
This module aims to provide Spring JMS implementation integrated with Service Bus, which should provide the following components:
- All kinds of configuration provider
 - Connection Factory to provide AMQP connection to Service Bus
 
- Only direct native ServiceBusJmsConnectionFactory implementation is used, which does not provide the caching feature for JMS administered resources, e.g. Connection, Session, Consumer, and producer.
 - The direct implementation is not production ready for its low workload as per consuming efficiency.
 - Dependency on azure-servicebus-jms lib is unnecessary.
 
- Spring integration simplifies the API of JMS API for sending and receiving messages.
 - Implement caching and pooled implementation for JMS ConnectionFactory for performance enhancement.
 - Provide auto-configure options for the connection factory and listener container.
 
Out Auto-configuration is based on the Spring JMS API.
A message listener container is used to receive messages from a JMS message queue and drive the MessageListener that is injected into it. The following is the class paradigm.

- 
SingleConnectionFactory subclass that adds Session caching as well MessageProducer caching.
 - 
By default, only one single Session will be cached, with further requested Sessions being created and disposed on demand. Consider raising the "sessionCacheSize" value in case of a high-concurrency environment
 - 
Spring's message listener containers support the use of a shared Connection within each listener container instance.
The following is the class paradigm.
 

- 
A JMS provider which pools Connection, Session and MessageProducer instances.
 - 
While this implementation does allow the creation of a collection of active consumers, it does not 'pool' consumers.
The following is the class paradigm.
 

In the spring-cloud-azure-auto-configure lib, under the package of com.azure.spring.cloud.autoconfigure.jms, provive the auto-configure configuration for spring jms support for Service Bus.
- ServiceBusJmsAutoConfiguration is the entry class for the auto-configuration.
 - ServiceBusJmsConnectionFactoryConfiguration declares implementations for Caching and Pooled Support of ConectionFactory. i.e. CachingConnectionFactory,JmsPoolConnectionFactory.
 - ServiceBusJmsContainerConfiguration declares bean of JmsListenerContainerFactory both for queue and topic of Service Bus.
 - Under the properties folder, ServiceBusJmsProperties provide the auto-configure properties.
 
- 
CachingConnectionFactory is the default JmsConnectionFactory.
 - 
JmsPoolConnectionFactory is activated when spring.jms.servicebus.pool.enabled=true.
 
- 
In general, we should use the default config of CachingConnectionFactory which need no config explicitly, and just tune the concurrency to expand consumers.
 - 
You should not increase the number of concurrent consumers for a JMS topic. This leads to concurrent consumption of the same message, which is hardly ever desirable.
 - 
JmsPoolConnectionFactory provide multiple connections which should be used if one connection does not satisfy your need. please refer which-is-better-pooledconnectionfactory-or-cachingconnectionfactory
 
- Spring Credential
 - Spring Cloud Azure 4.0 Design
 - Spring Cloud Azure AutoConfigure Design
 - Spring Cloud Azure Core Design
 - Spring Cloud Azure Messaging Design
 - Spring Cloud Azure Service Bus Spring Jms Support Design
 - Design for directory, module name and package path for Spring Cloud Azure messaging
 - Design for Remove warning logs of unknown configs for Kafka Passwordless
 - Design for Enhance AAD token authentication converter to customized granted authorities converter
 - Design for Enhance the ObjectMapper to support Spring Boot's pattern to enable autoconfiguration
 
- Passwordless connection support for Spring Cloud Azure
 - Passwordless connection support for MySQL
 - Passwordless connection support for Event Hubs Kafka
 - Remove warning logs of unknown configs for Kafka Passwordless