Package javax.jms

Examples of javax.jms.TopicSubscriber.receive()


         conn.start();
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicSubscriber newcons = newsess.createSubscriber(topic);
        
         Message m2 = (Message)newcons.receive(200);
         assertNull(m2);
      }
      finally
      {
         if (conn != null)
View Full Code Here


         Message m = sess.createTextMessage("testing123");
         pub.publish(m);
         sess.commit();
        
         //receive but rollback
         TextMessage m2 = (TextMessage)sub.receive(3000);
               
         assertNotNull(m2);
         assertEquals("testing123", m2.getText());
        
         sess.rollback();
View Full Code Here

         conn.start();
        
         TopicSession newsess = conn.createTopicSession(true, 0);
         TopicSubscriber newcons = newsess.createSubscriber(topic);
        
         Message m3 = (Message)newcons.receive(200);
         assertNull(m3);
      }
      finally
      {
         if (conn != null)
View Full Code Here

        
         Message m = sess.createTextMessage("testing123");
         pub.publish(m);
         sess.commit();
        
         TextMessage m2 = (TextMessage)cons.receive(3000);
         assertNotNull(m2);
         assertEquals("testing123", m2.getText());
        
         sess.rollback();
        
View Full Code Here

         assertNotNull(m2);
         assertEquals("testing123", m2.getText());
        
         sess.rollback();
        
         m2 = (TextMessage)cons.receive(3000);
         assertNotNull(m2);
         assertEquals("testing123", m2.getText());
        
         conn.close();
        
View Full Code Here

        
         Message m3 = newsess.createTextMessage("testing456");
         newpub.publish(m3);
         newsess.commit();
        
         TextMessage m4 = (TextMessage)newcons.receive(3000);
         assertNotNull(m4);
         assertEquals("testing456", m4.getText());
        
         newsess.commit();
        
View Full Code Here

         newsess.commit();
        
         newpub.publish(m3);
         newsess.commit();
        
         TextMessage m5 = (TextMessage)newcons.receive(3000);
         assertNotNull(m5);
         assertEquals("testing456", m5.getText());
        
         newsess.rollback();
        
View Full Code Here

         assertNotNull(m5);
         assertEquals("testing456", m5.getText());
        
         newsess.rollback();
        
         TextMessage m6 = (TextMessage)newcons.receive(3000);
         assertNotNull(m6);
         assertEquals("testing456", m6.getText());
        
         newsess.commit();
        
View Full Code Here

      }
      assertEquals(NUM_MESSAGES, count);

      log.debug("all messages received by sub1");

      Message m = sub2.receive(200);
     
      assertNull(m);
     
      conn2.start();
     
View Full Code Here

      conn2.start();
     
      count = 0;
      while (true)
      {
         TextMessage tm = (TextMessage)sub2.receive(200);
         if (tm == null)
         {
            break;
         }
         assertEquals("hello", 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.