Package javax.jms

Examples of javax.jms.Session.createDurableSubscriber()


         getLog().debug("Closing the subscriber.");
         subSession.close();

         getLog().debug("Subscribing to topic, looking for those Value = 'A'");
         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
         assertTrue("Should not be any A the subscription was changed", subscriber.receive(2000) == null);
         subSession.close();

         getLog().debug("Subscribing to topic, looking for everything");
         subSession = topicConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
View Full Code Here


         assertTrue("Should not be any A the subscription was changed", subscriber.receive(2000) == null);
         subSession.close();

         getLog().debug("Subscribing to topic, looking for everything");
         subSession = topicConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);

         message = sendSession.createTextMessage("Message4");
         message.setStringProperty("Value", "A");
         sender.send(message);
View Full Code Here

         assertTrue("Should be an A which we don't acknowledge", message.getStringProperty("Value").equals("A"));
         subSession.close();

         getLog().debug("Subscribing to topic, looking for the Value = 'A'");
         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
         assertTrue(
            "Should not be any A, the subscription was changed. Even though the old and new selectors match the message",
            subscriber.receive(2000) == null);
         subSession.close();
View Full Code Here

         Session sendSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer sender = sendSession.createProducer(topic);

         getLog().debug("Clearing the topic");
         Session subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer subscriber = subSession.createDurableSubscriber(topic, "test");
         TextMessage message = (TextMessage) subscriber.receive(50);
         while (message != null)
            message = (TextMessage) subscriber.receive(50);
         subSession.close();
View Full Code Here

            message = (TextMessage) subscriber.receive(50);
         subSession.close();

         getLog().debug("Subscribing to topic, with null selector");
         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);

         getLog().debug("Send a message");
         message = sendSession.createTextMessage("Message1");
         sender.send(message);
View Full Code Here

         getLog().debug("Closing the subscriber");
         subSession.close();

         getLog().debug("Subscribing to topic, with an empty selector");
         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         subscriber = subSession.createDurableSubscriber(topic, "test", "", false);

         getLog().debug("Send a message");
         message = sendSession.createTextMessage("Message2");
         sender.send(message);
View Full Code Here

         assertTrue("Expected an InvalidDestinationException for a null topic", caught);

         caught = false;
         try
         {
            session.createDurableSubscriber(null, "NotUsed");
         }
         catch (InvalidDestinationException expected)
         {
            caught = true;
         }
View Full Code Here

         assertTrue("Expected an InvalidDestinationException for a null topic", caught);

         caught = false;
         try
         {
            session.createDurableSubscriber(temp, "NotUsed");
         }
         catch (JMSException expected)
         {
            caught = true;
         }
View Full Code Here

         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);

         caught = false;
         try
         {
            session.createDurableSubscriber(null, "NotUsed", null, true);
         }
         catch (JMSException expected)
         {
            caught = true;
         }
View Full Code Here

         assertTrue("Expected an InvalidDestinationException for a null topic", caught);

         caught = false;
         try
         {
            session.createDurableSubscriber(temp, "NotUsed", null, true);
         }
         catch (JMSException expected)
         {
            caught = true;
         }
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.