Package javax.jms

Examples of javax.jms.Session.createDurableSubscriber()


      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = s.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);

      s.createDurableSubscriber(topic, "monicabelucci");

      ObjectName destObjectName =
         new ObjectName("jboss.messaging.destination:service=Topic,name=Topic");
      List subs = (List)ServerManagement.invoke(destObjectName, "listAllSubscriptions", null, null);
     
View Full Code Here


      conn = cf.createConnection();
      conn.setClientID("brookeburke");

      s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      MessageConsumer durable = s.createDurableSubscriber(topic, "monicabelucci");

      conn.start();

      TextMessage tm = (TextMessage)durable.receive(1000);
      assertEquals("k", tm.getText());
View Full Code Here

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = s.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);

      s.createDurableSubscriber(topic, "monicabelucci");

      prod.send(s.createTextMessage("one"));

      conn.close();
View Full Code Here

      conn = cf.createConnection();

      conn.setClientID("brookeburke");

      s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer durable = s.createDurableSubscriber(topic2, "monicabelucci");

      conn.start();

      Message m = durable.receive(1000);
      assertNull(m);
View Full Code Here

      prod.setDeliveryMode(DeliveryMode.PERSISTENT);

     
      //fails here
      MessageConsumer durable =
         s.createDurableSubscriber(topic,
                                   "monicabelucci",
                                   "color = 'red' AND shape = 'square'",
                                   false);

      TextMessage tm = s.createTextMessage("A red square message");
View Full Code Here

      conn.setClientID("brookeburke");

      s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      // modify the selector
      durable = s.createDurableSubscriber(topic,
                                          "monicabelucci",
                                          "color = 'red'",
                                          false);

      conn.start();
View Full Code Here

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Topic temporaryTopic = s.createTemporaryTopic();

      try
      {
         s.createDurableSubscriber(temporaryTopic, "mySubscription");
         fail("this should throw exception");
      }
      catch(InvalidDestinationException e)
      {
         // OK
View Full Code Here

      conn.setClientID("brookeburke");

      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = s.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
      MessageConsumer ds = s.createDurableSubscriber(topic, "monicabelucci");
      conn.start();

      prod.send(s.createTextMessage("one"));
      prod.send(s.createTextMessage("two"));
     
View Full Code Here

      s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      try
      {
         s.createDurableSubscriber(topic, "monicabelucci");
         fail("should throw exception");
      }
      catch(JMSException e)
      {
         // OK
View Full Code Here

      log.debug("topic redeployed");

      // since redeployment has an activation semantic, I expect to find the messages there

      topic = (Topic)ic.lookup("/topic/TopicToBeRedeployed");
      ds =  s.createDurableSubscriber(topic, "monicabelucci");
      conn.start();

      tm = (TextMessage)ds.receive(1000);
      assertEquals("two", 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.