-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
azure-springAll azure-spring related issuesAll azure-spring related issuesazure-spring-jmsIssues related to Spring JMS.Issues related to Spring JMS.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.
Milestone
Description
Current behavior
| Property (spring.jms.servicebus.pool.enabled and spring.jms.cache.enabled) not set or set to false | Property (spring.jms.servicebus.pool.enabled or spring.jms.cache.enabled) set to true | |
|---|---|---|
| sender side | ServiceBusJmsConnectionFactory | CachingConnectionFactory or JmsPoolConnectionFactory |
| receiver side | ServiceBusJmsConnectionFactory | CachingConnectionFactory or JmsPoolConnectionFactory |
Expected behavior
Comment from @vinaysurya
If we don't use a CachingConnectionFactory on Sender side, I'm afraid when using JMSTemplate every send from Spring SDK will create and close a connection which will be very inefficient.
| Property (spring.jms.servicebus.pool.enabled and spring.jms.cache.enabled) not set or set to false | Property (spring.jms.servicebus.pool.enabled or spring.jms.cache.enabled) set to true | |
|---|---|---|
| sender side | CachingConnectionFactory | CachingConnectionFactory or JmsPoolConnectionFactory |
| receiver side | ServiceBusJmsConnectionFactory | CachingConnectionFactory or JmsPoolConnectionFactory |
Relate codes
Lines 29 to 48 in d9d47b6
JmsListenerContainerFactory<?> jmsListenerContainerFactory( DefaultJmsListenerContainerFactoryConfigurer configurer, ConnectionFactory connectionFactory) { DefaultJmsListenerContainerFactory jmsListenerContainerFactory = new DefaultJmsListenerContainerFactory(); configurer.configure(jmsListenerContainerFactory, connectionFactory); jmsListenerContainerFactory.setPubSubDomain(Boolean.FALSE); configureCommonListenerContainerFactory(jmsListenerContainerFactory); return jmsListenerContainerFactory; } @Bean @ConditionalOnMissingBean(name = "topicJmsListenerContainerFactory") JmsListenerContainerFactory<?> topicJmsListenerContainerFactory( DefaultJmsListenerContainerFactoryConfigurer configurer, ConnectionFactory connectionFactory) { DefaultJmsListenerContainerFactory jmsListenerContainerFactory = new DefaultJmsListenerContainerFactory(); configurer.configure(jmsListenerContainerFactory, connectionFactory); jmsListenerContainerFactory.setPubSubDomain(Boolean.TRUE); configureCommonListenerContainerFactory(jmsListenerContainerFactory); configureTopicListenerContainerFactory(jmsListenerContainerFactory); return jmsListenerContainerFactory; } Lines 59 to 72 in 1ab5874
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { BindResult<Boolean> poolEnabledResult = Binder.get(environment).bind("spring.jms.servicebus.pool.enabled", Boolean.class); BindResult<Boolean> cacheEnabledResult = Binder.get(environment).bind("spring.jms.cache.enabled", Boolean.class); if (isPoolConnectionFactoryClassPresent() && poolEnabledResult.orElseGet(() -> false)) { registerJmsPoolConnectionFactory(registry); return; } if (isCacheConnectionFactoryClassPresent() && cacheEnabledResult.orElseGet(() -> false)) { registerJmsCachingConnectionFactory(registry); return; }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
azure-springAll azure-spring related issuesAll azure-spring related issuesazure-spring-jmsIssues related to Spring JMS.Issues related to Spring JMS.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.
Type
Projects
Status
Todo