Examples of createTopicSession()


Examples of javax.jms.TopicConnection.createTopicSession()

      {
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

         // Create 2 durable subscription and 2 non-durable subscription
         s.createDurableSubscriber(topic, "SubscriberA");
        
         s.createDurableSubscriber(topic, "SubscriberB", "wibble is null", false);
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

  
         conn = cf.createTopicConnection();
  
         conn.setClientID("Client1");
  
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = s.createProducer(topic);
         prod.setDeliveryMode(DeliveryMode.PERSISTENT);
  
         MessageConsumer cons = s.createDurableSubscriber(topic, "SubscriberA");
        
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

      TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
      Topic topic = null;
      TopicConnection connection = factory.createTopicConnection();
      try
      {
         TopicSession s = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         topic = s.createTemporaryTopic();
         TopicConnection connection2 = factory.createTopicConnection();
         try
         {
            connection2.createConnectionConsumer(topic, "", MockServerSessionPool.getServerSessionPool(), 1);
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

      InitialContext ctx = super.getInitialContext();
      Topic topicDest = (Topic) ctx.lookup("testCreateTopic");
      TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup("ConnectionFactory");
      TopicConnection tc = tcf.createTopicConnection();
      tc.start();
      TopicSession ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer mc = ts.createConsumer(topicDest);
      MessageProducer mp = ts.createProducer(topicDest);
      Message helloMsg = ts.createTextMessage("Hello from testCreateTopic");
      mp.send(helloMsg);
      log.info("Producer sent: "+helloMsg);
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

     
      Topic topic = (Topic) getInitialContext().lookup("testCreateTopic");
      TopicConnectionFactory cf = (TopicConnectionFactory) getInitialContext().lookup("ConnectionFactory");
     
      TopicConnection connection = cf.createTopicConnection();
      TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      session.createSubscriber(topic);
     
      TopicPublisher pub = session.createPublisher(topic);
      try
      {
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

      Topic topic = (Topic) context.lookup(TEST_TOPIC);
      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
      TopicPublisher sender1 = session1.createPublisher(topic);

      //Now a sender
      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicPublisher sender2 = session2.createPublisher(topic);

      drainMessagesForTopic(subscriber1);

      //send some messages
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

      Topic topic = (Topic) context.lookup(TEST_TOPIC);
      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
      TopicPublisher sender1 = session1.createPublisher(topic);

      // Session 2
      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicSubscriber subscriber2 = session2.createSubscriber(topic, null, true);
      TopicPublisher sender2 = session2.createPublisher(topic);

      drainMessagesForTopic(subscriber1);
      drainMessagesForTopic(subscriber2);
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

            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);
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

            // Create a connection and start it
            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send messages which don't match and do match the selector, checking message count
            TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
            TopicPublisher publisher = pubSession.createPublisher(topic);

            publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
            pubSession.commit();
View Full Code Here

Examples of javax.jms.TopicConnection.createTopicSession()

            // Create a connection and start it
            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send new message matching the topic, checking message count
            TopicSession session = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = session.createTopic(TOPIC_NAME);
            TopicPublisher publisher = session.createPublisher(topic);

            publishMessages(session, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "indifferent");
            session.commit();
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.