Package javax.jms

Examples of javax.jms.TopicSession.commit()


            publisher = session1.createPublisher(null);
        }
        sub.close();
        TopicSubscriber sub2 = session1.createDurableSubscriber(topic2, "subscription0");
        publisher.publish(topic, session1.createTextMessage("hello"));
        session1.commit();
        if (!shutdown)
        {
            m = (TextMessage) sub2.receive(2000);
            assertNull(m);
            session1.commit();
View Full Code Here


        session1.commit();
        if (!shutdown)
        {
            m = (TextMessage) sub2.receive(2000);
            assertNull(m);
            session1.commit();
        }
        publisher.publish(topic2, session1.createTextMessage("goodbye"));
        session1.commit();
        m = (TextMessage) sub2.receive(2000);
        assertNotNull(m);
View Full Code Here

            m = (TextMessage) sub2.receive(2000);
            assertNull(m);
            session1.commit();
        }
        publisher.publish(topic2, session1.createTextMessage("goodbye"));
        session1.commit();
        m = (TextMessage) sub2.receive(2000);
        assertNotNull(m);
        assertEquals("goodbye", m.getText());
        session1.unsubscribe("subscription0");
        con.close();
View Full Code Here

        con2.start();

        publisher.publish(session1.createTextMessage("Hello"));
        session1.commit();
        TextMessage tm = (TextMessage) sub.receive(2000);
        session2.commit();
        assertNotNull(tm);
        con2.close();
        publisher.publish(session1.createTextMessage("Hello2"));
        session1.commit();
        con2 =  (AMQConnection) getClientConnection("guest", "guest", "clientid");
View Full Code Here

        con2 =  (AMQConnection) getClientConnection("guest", "guest", "clientid");
        session2 = con2.createTopicSession(true, AMQSession.NO_ACKNOWLEDGE);
        sub = session2.createDurableSubscriber(topic, "subscription0");
        con2.start();
        tm = (TextMessage) sub.receive(2000);
        session2.commit();
        assertNotNull(tm);
        assertEquals("Hello2", tm.getText());
        session2.unsubscribe("subscription0");
        con1.close();
        con2.close();
View Full Code Here

        TopicPublisher publisher = session1.createPublisher(topic);
        MessageConsumer consumer1 = session1.createConsumer(topic);
        con.start();
        TextMessage tm = session1.createTextMessage("Hello");
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(10000L);
        assertNotNull(tm);
        String msgText = tm.getText();
        assertEquals("Hello", msgText);
        tm = session1.createTextMessage();
View Full Code Here

        assertEquals("Hello", msgText);
        tm = session1.createTextMessage();
        msgText = tm.getText();
        assertNull(msgText);
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(10000L);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertNull(msgText);
View Full Code Here

        assertNull(msgText);
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(10000L);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertNull(msgText);
        tm.clearBody();
        tm.setText("Now we are not null");
        publisher.publish(tm);
View Full Code Here

        msgText = tm.getText();
        assertNull(msgText);
        tm.clearBody();
        tm.setText("Now we are not null");
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(2000);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertEquals("Now we are not null", msgText);
View Full Code Here

        tm.setText("Now we are not null");
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(2000);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertEquals("Now we are not null", msgText);

        tm = session1.createTextMessage("");
        msgText = tm.getText();
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.