Examples of createDurableSubscriber()


Examples of javax.jms.QueueSession.createDurableSubscriber()

        QueueSession queueSession = getQueueSession();
        Topic topic = getTestTopic();

        try
        {
            queueSession.createDurableSubscriber(topic, "abc");
            fail("expected exception did not occur");
        }
        catch (javax.jms.IllegalStateException s)
        {
            // PASS
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

    ConnectionFactory tcf = (ConnectionFactory) ictx.lookup("tcf");
    ictx.close();

    Connection cnx = tcf.createConnection();
    Session session = cnx.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
    TopicSubscriber subscriber = session.createDurableSubscriber(topic, "durable");
    subscriber.setMessageListener(new MsgListener());

    cnx.start();

    System.in.read();
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

    protected MessageConsumer createConsumer() throws JMSException {
        Session session = producer.getSession();
        if (subscriberName != null) {
            if (destination instanceof Topic) {
                Topic topic = (Topic) destination;
                return session.createDurableSubscriber(topic, subscriberName, messageSelector, noLocal);
            }
            else {
                throw new IllegalArgumentException("Cannot specify the subscriberName property when using a Queue destination");
            }
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

         else
         {
            //Durable subscription
            if (selector == null)
            {
               consumer = sess.createDurableSubscriber((Topic)sourceDestination, subName);
            }
            else
            {
               consumer = sess.createDurableSubscriber((Topic)sourceDestination, subName, selector, false);
            }
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

            {
               consumer = sess.createDurableSubscriber((Topic)sourceDestination, subName);
            }
            else
            {
               consumer = sess.createDurableSubscriber((Topic)sourceDestination, subName, selector, false);
            }
         }
        
         //Now the sending session
        
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

      Connection conn = cf.createConnection();
      conn.setClientID("five");

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

      MessageConsumer ds = s.createDurableSubscriber(thisTopic, "sub", null, false);

      MessageProducer p = s.createProducer(thisTopic);
      p.setDeliveryMode(DeliveryMode.PERSISTENT);
      TextMessage tm = s.createTextMessage("thebody");
      p.send(tm);
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

      conn.setClientID("five");

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

      ds = s.createDurableSubscriber(thisTopic, "sub", null, false);

      TextMessage rm = (TextMessage)ds.receive(3000);
      assertNotNull(rm);
      assertEquals("thebody", rm.getText());
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

      Connection conn = cf.createConnection();
      conn.setClientID("Sausages");
     
      Session sessConsume = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
     
      MessageConsumer sub1 = sessConsume.createDurableSubscriber(topic, "sub1", null, false);
      MessageConsumer sub2 = sessConsume.createDurableSubscriber(topic, "sub2", null, false);
      MessageConsumer sub3 = sessConsume.createDurableSubscriber(topic, "sub3", null, false);
     
     
      Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

      conn.setClientID("Sausages");
     
      Session sessConsume = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
     
      MessageConsumer sub1 = sessConsume.createDurableSubscriber(topic, "sub1", null, false);
      MessageConsumer sub2 = sessConsume.createDurableSubscriber(topic, "sub2", null, false);
      MessageConsumer sub3 = sessConsume.createDurableSubscriber(topic, "sub3", null, false);
     
     
      Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = sessSend.createProducer(topic);
View Full Code Here

Examples of javax.jms.Session.createDurableSubscriber()

     
      Session sessConsume = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
     
      MessageConsumer sub1 = sessConsume.createDurableSubscriber(topic, "sub1", null, false);
      MessageConsumer sub2 = sessConsume.createDurableSubscriber(topic, "sub2", null, false);
      MessageConsumer sub3 = sessConsume.createDurableSubscriber(topic, "sub3", null, false);
     
     
      Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = sessSend.createProducer(topic);
      prod.setDeliveryMode(DeliveryMode.PERSISTENT);
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.