Package javax.jms

Examples of javax.jms.TopicSession.createDurableSubscriber()


         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 (InvalidDestinationException 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 (InvalidDestinationException 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 (InvalidDestinationException expected)
         {
            caught = true;
         }
View Full Code Here

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

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

         assertTrue("Expected a Exception for a null subscription", caught);

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

         assertTrue("Expected a Exception for a null subscription", caught);

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

         assertTrue("Expected a Exception for an empty subscription", caught);

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

      //set up some subscribers to the topic
      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      Topic topic = (Topic) context.lookup(TEST_TOPIC);

      TopicSubscriber sub1 = session.createDurableSubscriber(topic, "sub1");
      TopicSubscriber sub2 = session.createSubscriber(topic);
      TopicSubscriber sub3 = session.createSubscriber(topic);

      //Now a sender
      TopicPublisher sender = session.createPublisher(topic);
View Full Code Here

      }

      drainMessagesForTopic(sub3);

      //open subscribers again.
      sub1 = session.createDurableSubscriber(topic, "sub1");
      sub2 = session.createSubscriber(topic);

      //Send a final message
      sender.publish(session.createTextMessage("Final message"));
      sender.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.