Package javax.jms

Examples of javax.jms.TopicConnection.start()


         TopicConnectionFactory factory = new XBConnectionFactory(null, this.cmdLine, false);
         // should be retreived via jndi
         Topic topic = new XBDestination("jms-test", null, false);
     
         TopicConnection connection = factory.createTopicConnection();
         connection.start();
         TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         TopicSubscriber subscriber = session.createSubscriber(topic);
         subscriber.setMessageListener(this);
     
         TopicPublisher publisher = session.createPublisher(topic);
View Full Code Here


         pub.publish(m);
         sess.commit();
        
         conn.close();
         conn = cf.createTopicConnection();
         conn.start();
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicSubscriber newcons = newsess.createSubscriber(topic);
        
         Message m2 = (Message)newcons.receive(200);
View Full Code Here

      TopicConnection conn = null;
     
      try
      {
         conn = cf.createTopicConnection();
         conn.start();
         TopicSession sess = conn.createTopicSession(true, 0);
         TopicPublisher pub = sess.createPublisher(topic);
         TopicSubscriber sub = sess.createSubscriber(topic);
         pub.setDeliveryMode(DeliveryMode.PERSISTENT);
        
View Full Code Here

        
         sess.rollback();
        
         conn.close();
         conn = cf.createTopicConnection();
         conn.start();
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicSubscriber newcons = newsess.createSubscriber(topic);
        
         Message m3 = (Message)newcons.receive(200);
View Full Code Here

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

         assertEquals("testing123", m2.getText());
        
         conn.close();
        
         conn = cf.createTopicConnection();
         conn.start();
        
         //test 2
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicPublisher newpub = newsess.createPublisher(topic);
View Full Code Here

      Message m = sub2.receive(200);
     
      assertNull(m);
     
      conn2.start();
     
      count = 0;
      while (true)
      {
         TextMessage tm = (TextMessage)sub2.receive(200);
View Full Code Here

         int count = ((Integer)ServerManagement.getAttribute(destObjectName, "AllMessageCount")).intValue();
        
         assertEquals(2, count);
        
         // Start the connection for delivery
         conn.start();
        
         // Remove all messages from the topic
        
         //Need to pause since delivery may still be in progress
         Thread.sleep(2000);
View Full Code Here

         count = ((Integer)ServerManagement.getAttribute(destObjectName, "AllMessageCount")).intValue();
        
         assertEquals(1, count);

         // Start the connection for delivery
         conn.start();
        
         // Remove all messages from the topic
         ServerManagement.invoke(destObjectName, "removeAllMessages", null, null);
  
         count = ((Integer)ServerManagement.getAttribute(destObjectName, "AllMessageCount")).intValue();
View Full Code Here

         // Now create another durable subscription
         s.createDurableSubscriber(topic, "SubscriberB");
        
         //Now consume
        
         conn.start();
        
         TextMessage rm1 = (TextMessage)cons.receive(500);
         assertNotNull(rm1);
         assertEquals(tm1.getText(), rm1.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.