Package javax.jms

Examples of javax.jms.XAConnection.start()


         xaConn = cf.createXAConnection();

         XASession xaSession = xaConn.createXASession();

         xaConn.start();

         MessageConsumer cons = xaSession.createConsumer(queue1);

         //Now we enlist the session in an xa transaction
View Full Code Here


         res1.start(xid1, XAResource.TMNOFLAGS);

         MessageConsumer cons = xsess1.createConsumer(queue1);

         xconn1.start();

         // Consume the message

         TextMessage rm1 = (TextMessage)cons.receive(1000);
View Full Code Here

    public void testVanilaTransactionalProduceReceive() throws Exception {
       
        ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        XAConnection connection1 = (XAConnection)cf1.createConnection();
        connection1.start();
        XASession session = connection1.createXASession();
        XAResource resource = session.getXAResource();
        Destination dest = new ActiveMQQueue(getName());
       
        // publish a message
View Full Code Here

   
    public void testConsumerCloseTransactionalSendReceive() throws Exception {
       
        ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        XAConnection connection1 = (XAConnection)cf1.createConnection();
        connection1.start();
        XASession session = connection1.createXASession();
        XAResource resource = session.getXAResource();
        Destination dest = new ActiveMQQueue(getName());
       
        // publish a message
View Full Code Here

    public void testSessionCloseTransactionalSendReceive() throws Exception {
       
        ActiveMQXAConnectionFactory cf1 = new ActiveMQXAConnectionFactory("vm://localhost?broker.persistent=false");
        XAConnection connection1 = (XAConnection)cf1.createConnection();
        connection1.start();
        XASession session = connection1.createXASession();
        XAResource resource = session.getXAResource();
        Destination dest = new ActiveMQQueue(getName());
       
        // publish a message
View Full Code Here

        BrokerService broker = BrokerFactory.createBroker(new URI("broker:(tcp://localhost:0)/" + brokerName));
        broker.start();
        broker.waitUntilStarted();
        ActiveMQXAConnectionFactory cf = new ActiveMQXAConnectionFactory(broker.getTransportConnectors().get(0).getConnectUri());
        XAConnection connection = (XAConnection)cf.createConnection();
        connection.start();
        XASession session = connection.createXASession();
        XAResource resource = session.getXAResource();
        Destination dest = new ActiveMQQueue(getName());

        // publish a message
View Full Code Here

        
         xaConn = ((XAConnectionFactory)cf).createXAConnection();
        
         XASession consumerSess = xaConn.createXASession();
         MessageConsumer consumer = consumerSess.createConsumer(queue);
         xaConn.start();
        
         DummyXAResource res = new DummyXAResource();
        
         mgr.begin();
        
View Full Code Here

         xaConn1 = xaCF.createXAConnection();
        
         assertEquals(1, ((JBossConnection)xaConn1).getServerID());

         xaConn1.start();
                 

         // register a failover listener
         SimpleFailoverListener failoverListener = new SimpleFailoverListener();
         ((JBossConnection)xaConn1).registerFailoverListener(failoverListener);
View Full Code Here

         conn = xaCF.createXAConnection();
         conn.close();

         // create a connection to node 1
         conn = xaCF.createXAConnection();
         conn.start();

         assertEquals(1, ((JBossConnection)conn).getServerID());

         // register a failover listener
         SimpleFailoverListener failoverListener = new SimpleFailoverListener();
View Full Code Here

        ActiveMQXAConnectionFactory xacf = new ActiveMQXAConnectionFactory();
        xacf.setBrokerURL(url);
        ActiveMQQueue queue = new ActiveMQQueue();
        queue.setPhysicalName(qName);
        XAConnection xaconn = xacf.createXAConnection();
        xaconn.start();
        XASession session = xaconn.createXASession();
        XAResource xares = session.getXAResource();
        MessageConsumer receiver = session.getSession().createConsumer(queue);
        xares.recover(XAResource.TMSTARTRSCAN);
        xares.recover(XAResource.TMNOFLAGS);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.