/** * Sets the cache level by name for the underlying JMS resources. * Possible values are: CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, and CACHE_SESSION. * The default setting is CACHE_AUTO. See the Spring documentation and Transactions Cache Levels for more information. */ @Metadata(defaultValue = "CACHE_AUTO", label = "consumer", enums = "CACHE_AUTO,CACHE_CONNECTION,CACHE_CONSUMER,CACHE_NONE,CACHE_SESSION", description = "Sets the cache level by name for the underlying JMS resources." + " Possible values are: CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, and CACHE_SESSION." + " The default setting is CACHE_AUTO. See the Spring documentation and Transactions Cache Levels for more information.") public void setCacheLevelName(String cacheName) { getConfiguration().setCacheLevelName(cacheName); }
@ManagedAttribute public void setCacheLevelName(String cacheName) { getConfiguration().setCacheLevelName(cacheName); }
private void createCamelContext() throws Exception { CamelContext camelContext = getContext(); ConnectionFactory jmsConnectFactory = createConnectionFactory(); PooledConnectionFactory jmsPooledConnectionFactory = new PooledConnectionFactory(); jmsPooledConnectionFactory.setConnectionFactory(jmsConnectFactory); jmsPooledConnectionFactory.setMaxConnections(2); JmsTransactionManager jmsTransactionManager = new JmsTransactionManager(); jmsTransactionManager.setConnectionFactory(jmsConnectFactory); JmsConfiguration jmsConfiguration = new JmsConfiguration(); jmsConfiguration.setConnectionFactory(jmsPooledConnectionFactory); jmsConfiguration.setTransacted(true); jmsConfiguration.setTransactionManager(jmsTransactionManager); jmsConfiguration.setCacheLevelName("CACHE_CONSUMER"); JmsComponent jms = new JmsComponent(); jms.setConfiguration(jmsConfiguration); camelContext.addComponent("jms", jms); }