Search in sources :

Example 1 with XaPooledConnectionFactory

use of org.apache.activemq.pool.XaPooledConnectionFactory in project cxf by apache.

the class MessageListenerTest method createXAConnection.

private Connection createXAConnection(String name, TransactionManager tm) throws JMSException {
    ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory("vm://" + name + "?broker.persistent=false");
    cf.setRedeliveryPolicy(redeliveryPolicy());
    XaPooledConnectionFactory cfp = new XaPooledConnectionFactory(cf);
    cfp.setTransactionManager(tm);
    cfp.setConnectionFactory(cf);
    Connection connection = cfp.createConnection();
    connection.start();
    return connection;
}
Also used : XaPooledConnectionFactory(org.apache.activemq.pool.XaPooledConnectionFactory) Connection(javax.jms.Connection) ActiveMQXAConnectionFactory(org.apache.activemq.ActiveMQXAConnectionFactory)

Aggregations

Connection (javax.jms.Connection)1 ActiveMQXAConnectionFactory (org.apache.activemq.ActiveMQXAConnectionFactory)1 XaPooledConnectionFactory (org.apache.activemq.pool.XaPooledConnectionFactory)1