Package javax.jms

Examples of javax.jms.TopicSession.createSubscriber()


            String type = arg0.getParameter("type");
            PrintWriter out = arg1.getWriter();

            TopicConnection connection = tcf.createTopicConnection();
            TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            TopicSubscriber topicSubscriber = session.createSubscriber(topic);
            TestListener test = new TestListener();
            topicSubscriber.setMessageListener(test);
            connection.start();
            TopicPublisher topicPublisher = session.createPublisher(topic);
            TextMessage tmsg = session.createTextMessage("JMS - Test Topic Message");
View Full Code Here


      {
         conn = cf.createTopicConnection();
         conn.start();
         TopicSession sess = conn.createTopicSession(true, 0);
         TopicPublisher pub = sess.createPublisher(topic1);
         TopicSubscriber sub = sess.createSubscriber(topic1);
         pub.setDeliveryMode(DeliveryMode.PERSISTENT);
        
         Message m = sess.createTextMessage("testing123");
         pub.publish(m);
         sess.commit();
View Full Code Here

      try
      {
         conn = cf.createTopicConnection();
         TopicSession sess = conn.createTopicSession(true, 0);
         TopicPublisher pub = sess.createPublisher(topic1);
         TopicSubscriber cons = sess.createSubscriber(topic1);
         conn.start();
        
         Message m = sess.createTextMessage("testing123");
         pub.publish(m);
         sess.commit();
View Full Code Here

        
         //test 2
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicPublisher newpub = newsess.createPublisher(topic1);
         TopicSubscriber newcons = newsess.createSubscriber(topic1);
        
         Message m3 = newsess.createTextMessage("testing456");
         newpub.publish(m3);
         newsess.commit();
        
View Full Code Here

        TopicSession topicSession =
          topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
 
        Topic topic = (Topic)ctx.lookup(topicName);
 
        TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
     
        topicSubscriber.setMessageListener(this);
        topicConnection.start();
View Full Code Here

            topicConnectionFactory = (TopicConnectionFactory) lookup(ctx, tcfBindingName);
            final TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(username, password);
            topicConnection.start();
            final TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            final Topic topic = (Topic) ctx.lookup(topicBindingName);
            final TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
            topicSubscriber.setMessageListener(this);
        } catch (final JMSException e) {
            logger.error("Could not read JMS message.", e);
        } catch (final NamingException e) {
            logger.error("Could not read JMS message.", e);
View Full Code Here

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createSubscriber " + session + " topic=" + topic);
         }

         TopicSubscriber result = session.createSubscriber(topic);
         result = new HornetQRATopicSubscriber(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdSubscriber " + session + " HornetQTopicSubscriber=" + result);
View Full Code Here

                                       messageSelector +
                                       " noLocal=" +
                                       noLocal);
         }

         TopicSubscriber result = session.createSubscriber(topic, messageSelector, noLocal);
         result = new HornetQRATopicSubscriber(result, this);

         if (HornetQRASession.trace)
         {
            HornetQRASession.log.trace("createdSubscriber " + session + " HornetQTopicSubscriber=" + result);
View Full Code Here

      TopicSession sess1 = conn1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicSession sess2 = conn2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      TopicSubscriber sub1 = sess1.createSubscriber(HornetQServerTestCase.topic1);
      TopicSubscriber sub2 = sess2.createSubscriber(HornetQServerTestCase.topic1);

      conn1.start();

      Connection conn3 = JMSTestCase.cf.createConnection();
View Full Code Here

      try
      {
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         TopicPublisher publisher = s.createPublisher(HornetQServerTestCase.topic1);
         TopicSubscriber sub = s.createSubscriber(HornetQServerTestCase.topic1);
         conn.start();

         // Create 3 object messages with different bodies

         TestObject to1 = new TestObject();
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.