Polish "Configure ActiveMQConnectionFactory properly without spring-jms"

See gh-36767
pull/37210/head
Stephane Nicoll 1 year ago
parent bcfaad2cb8
commit 5e11bac1da

@ -51,10 +51,10 @@ class ArtemisConnectionFactoryConfiguration {
@Bean(name = "jmsConnectionFactory") @Bean(name = "jmsConnectionFactory")
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "false") @ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "false")
ActiveMQConnectionFactory jmsConnectionFactory(ArtemisProperties properties, ListableBeanFactory beanFactory) { ActiveMQConnectionFactory jmsConnectionFactory(ArtemisProperties properties, ListableBeanFactory beanFactory) {
return createConnectionFactory(properties, beanFactory); return createJmsConnectionFactory(properties, beanFactory);
} }
private static ActiveMQConnectionFactory createConnectionFactory(ArtemisProperties properties, private static ActiveMQConnectionFactory createJmsConnectionFactory(ArtemisProperties properties,
ListableBeanFactory beanFactory) { ListableBeanFactory beanFactory) {
return new ArtemisConnectionFactoryFactory(beanFactory, properties) return new ArtemisConnectionFactoryFactory(beanFactory, properties)
.createConnectionFactory(ActiveMQConnectionFactory.class); .createConnectionFactory(ActiveMQConnectionFactory.class);
@ -71,7 +71,7 @@ class ArtemisConnectionFactoryConfiguration {
ArtemisProperties properties, ListableBeanFactory beanFactory) { ArtemisProperties properties, ListableBeanFactory beanFactory) {
JmsProperties.Cache cacheProperties = jmsProperties.getCache(); JmsProperties.Cache cacheProperties = jmsProperties.getCache();
CachingConnectionFactory connectionFactory = new CachingConnectionFactory( CachingConnectionFactory connectionFactory = new CachingConnectionFactory(
createConnectionFactory(properties, beanFactory)); createJmsConnectionFactory(properties, beanFactory));
connectionFactory.setCacheConsumers(cacheProperties.isConsumers()); connectionFactory.setCacheConsumers(cacheProperties.isConsumers());
connectionFactory.setCacheProducers(cacheProperties.isProducers()); connectionFactory.setCacheProducers(cacheProperties.isProducers());
connectionFactory.setSessionCacheSize(cacheProperties.getSessionCacheSize()); connectionFactory.setSessionCacheSize(cacheProperties.getSessionCacheSize());

Loading…
Cancel
Save