Search in sources :

Example 1 with EmbeddedJMS

use of org.hornetq.jms.server.embedded.EmbeddedJMS in project jbpm by kiegroup.

the class AsyncAuditLogProducerTest method startHornetQServer.

private void startHornetQServer() throws Exception {
    jmsServer = new EmbeddedJMS();
    jmsServer.start();
    logger.debug("Started Embedded JMS Server");
    XAConnectionFactory connectionFactory = (XAConnectionFactory) jmsServer.lookup("ConnectionFactory");
    new InitialContext().rebind("java:comp/UserTransaction", com.arjuna.ats.jta.UserTransaction.userTransaction());
    new InitialContext().rebind("java:comp/TransactionManager", com.arjuna.ats.jta.TransactionManager.transactionManager());
    new InitialContext().rebind("java:comp/TransactionSynchronizationRegistry", new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple());
    factory = new ConnectionFactoryProxy(connectionFactory, new TransactionHelperImpl(com.arjuna.ats.jta.TransactionManager.transactionManager()));
    queue = (Queue) jmsServer.lookup("/queue/exampleQueue");
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) EmbeddedJMS(org.hornetq.jms.server.embedded.EmbeddedJMS) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl) XAConnectionFactory(javax.jms.XAConnectionFactory) InitialContext(javax.naming.InitialContext)

Example 2 with EmbeddedJMS

use of org.hornetq.jms.server.embedded.EmbeddedJMS in project jbpm by kiegroup.

the class JmsAvaiableJobExecutorTest method startHornetQServer.

private void startHornetQServer() throws Exception {
    jmsServer = new EmbeddedJMS();
    jmsServer.start();
    logger.debug("Started Embedded JMS Server");
    XAConnectionFactory connectionFactory = (XAConnectionFactory) jmsServer.lookup("ConnectionFactory");
    new InitialContext().rebind("java:comp/UserTransaction", com.arjuna.ats.jta.UserTransaction.userTransaction());
    new InitialContext().rebind("java:comp/TransactionManager", com.arjuna.ats.jta.TransactionManager.transactionManager());
    new InitialContext().rebind("java:comp/TransactionSynchronizationRegistry", new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple());
    factory = new ConnectionFactoryProxy(connectionFactory, new TransactionHelperImpl(com.arjuna.ats.jta.TransactionManager.transactionManager()));
    queue = (Queue) jmsServer.lookup("/queue/exampleQueue");
}
Also used : ConnectionFactoryProxy(org.jboss.narayana.jta.jms.ConnectionFactoryProxy) EmbeddedJMS(org.hornetq.jms.server.embedded.EmbeddedJMS) TransactionHelperImpl(org.jboss.narayana.jta.jms.TransactionHelperImpl) XAConnectionFactory(javax.jms.XAConnectionFactory) InitialContext(javax.naming.InitialContext)

Aggregations

XAConnectionFactory (javax.jms.XAConnectionFactory)2 InitialContext (javax.naming.InitialContext)2 EmbeddedJMS (org.hornetq.jms.server.embedded.EmbeddedJMS)2 ConnectionFactoryProxy (org.jboss.narayana.jta.jms.ConnectionFactoryProxy)2 TransactionHelperImpl (org.jboss.narayana.jta.jms.TransactionHelperImpl)2