use of org.springframework.jms.connection.JmsTransactionManager in project camel by apache.
the class JmsComponent method jmsComponentTransacted.
public static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory) {
JmsTransactionManager transactionManager = new JmsTransactionManager();
transactionManager.setConnectionFactory(connectionFactory);
return jmsComponentTransacted(connectionFactory, transactionManager);
}
use of org.springframework.jms.connection.JmsTransactionManager in project ddf by codice.
the class OpenwireProducerConsumerExample method createCamelContext.
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);
}
use of org.springframework.jms.connection.JmsTransactionManager in project camel by apache.
the class JmsConfiguration method createTransactionManager.
/**
* Factory method which which allows derived classes to customize the lazy
* transaction manager creation
*/
protected PlatformTransactionManager createTransactionManager() {
JmsTransactionManager answer = new JmsTransactionManager();
answer.setConnectionFactory(getConnectionFactory());
return answer;
}
Aggregations