Package javax.jms

Examples of javax.jms.TopicSession.commit()


        session1.commit();

        //test normal subscriber gets message
        m = (TextMessage) normal.receive(1000);
        assertNotNull(m);
        session1.commit();

        //test selector subscriber does get message
        m = (TextMessage) select.receive(1000);
        assertNotNull(m);
        session1.commit();
View Full Code Here


        session1.commit();

        //test selector subscriber does get message
        m = (TextMessage) select.receive(1000);
        assertNotNull(m);
        session1.commit();

        //test nolocal subscriber doesn't message
        m = (TextMessage) noLocal.receive(100);
        assertNull(m);
View Full Code Here

        message = session2.createTextMessage("hello2");
        message.setStringProperty("Selector", "select");

        publisher2.publish(message);
        session2.commit();

        //test normal subscriber gets message
        m = (TextMessage) normal.receive(1000);
        assertNotNull(m);
        session1.commit();
View Full Code Here

        TextMessage message;

        // Send non-matching message
        message = session.createTextMessage("non-matching 1");
        publisher.publish(message);
        session.commit();

        // Send and consume matching message
        message = session.createTextMessage("hello");
        message.setStringProperty("Selector", "select");
View Full Code Here

        // Send and consume matching message
        message = session.createTextMessage("hello");
        message.setStringProperty("Selector", "select");

        publisher.publish(message);
        session.commit();

        m = (TextMessage) selector.receive(1000);
        assertNotNull("should have received message", m);
        assertEquals("Message contents were wrong", "hello", m.getText());
View Full Code Here

        assertEquals("Message contents were wrong", "hello", m.getText());

        // Send non-matching message
        message = session.createTextMessage("non-matching 2");
        publisher.publish(message);
        session.commit();

        // Assert queue count is 0
        long depth = ((AMQTopicSessionAdaptor) session).getSession().getQueueDepth(topic);
        assertEquals("Queue depth was wrong", 0, depth);
View Full Code Here

        con.start();

        TextMessage tm = session1.createTextMessage("Hello");
        publisher.publish(tm);
        session1.commit();

        tm = (TextMessage) sub.receive(2000);
        assertNotNull(tm);
        session1.commit();
        session1.unsubscribe("subscription0");
View Full Code Here

        publisher.publish(tm);
        session1.commit();

        tm = (TextMessage) sub.receive(2000);
        assertNotNull(tm);
        session1.commit();
        session1.unsubscribe("subscription0");

        try
        {
            session1.unsubscribe("not a subscription");
View Full Code Here

        TopicPublisher publisher = session1.createPublisher(null);

        con.start();

        publisher.publish(topic, session1.createTextMessage("hello"));
        session1.commit();
        TextMessage m = (TextMessage) sub.receive(2000);
        assertNotNull(m);
        session1.commit();

        if (shutdown)
View Full Code Here

        publisher.publish(topic, session1.createTextMessage("hello"));
        session1.commit();
        TextMessage m = (TextMessage) sub.receive(2000);
        assertNotNull(m);
        session1.commit();

        if (shutdown)
        {
            session1.close();
            con.close();
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.