下面列出了怎么用org.springframework.boot.autoconfigure.jms.JmsProperties的API类实例代码及写法,或者点击链接到github查看源代码。
@Bean
@ConditionalOnProperty(prefix = "spring.jms.cache", name = "enabled", havingValue = "true", matchIfMissing = true)
public CachingConnectionFactory cachingJmsConnectionFactory(MQConfigurationProperties properties,
ObjectProvider<List<MQConnectionFactoryCustomizer>> factoryCustomizers, JmsProperties jmsProperties) {
JmsProperties.Cache cacheProperties = jmsProperties.getCache();
MQConnectionFactory wrappedConnectionFactory = createConnectionFactory(properties, factoryCustomizers);
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(wrappedConnectionFactory);
connectionFactory.setCacheConsumers(cacheProperties.isConsumers());
connectionFactory.setCacheProducers(cacheProperties.isProducers());
connectionFactory.setSessionCacheSize(cacheProperties.getSessionCacheSize());
return connectionFactory;
}