Search in sources :

Example 1 with JmsTransactionManager

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);
}
Also used : JmsTransactionManager(org.springframework.jms.connection.JmsTransactionManager)

Example 2 with JmsTransactionManager

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);
}
Also used : CamelContext(org.apache.camel.CamelContext) ActiveMQSslConnectionFactory(org.apache.activemq.ActiveMQSslConnectionFactory) ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) ConnectionFactory(javax.jms.ConnectionFactory) JmsComponent(org.apache.camel.component.jms.JmsComponent) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) JmsConfiguration(org.apache.camel.component.jms.JmsConfiguration) JmsTransactionManager(org.springframework.jms.connection.JmsTransactionManager)

Example 3 with JmsTransactionManager

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;
}
Also used : JmsTransactionManager(org.springframework.jms.connection.JmsTransactionManager)

Aggregations

JmsTransactionManager (org.springframework.jms.connection.JmsTransactionManager)3 ConnectionFactory (javax.jms.ConnectionFactory)1 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 ActiveMQSslConnectionFactory (org.apache.activemq.ActiveMQSslConnectionFactory)1 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)1 CamelContext (org.apache.camel.CamelContext)1 JmsComponent (org.apache.camel.component.jms.JmsComponent)1 JmsConfiguration (org.apache.camel.component.jms.JmsConfiguration)1