Package javax.jms

Examples of javax.jms.TopicSubscriber.receive()


            subscriber = session.createDurableSubscriber(topic, getTestName(), null, true);
            connection.start();

            producer.send(createNextMessage(session, 1));

            Message m = subscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNull("Unexpected message received", m);
        }
        finally
        {
            session.unsubscribe(getTestName());
View Full Code Here


            subscriber = consumerSession.createDurableSubscriber(topic, getTestName(), null, true);
            connection.start();

            producer.send(createNextMessage(producerSession, 1));

            Message m = subscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNull("Unexpected message received", m);
        }
        finally
        {
            consumerSession.unsubscribe(getTestName());
View Full Code Here

            subscriber = consumerSession.createDurableSubscriber(topic, getTestName(), null, true);
            connection.start();

            producer.send(createNextMessage(producerSession, 1));

            Message m = subscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNull("Unexpected message received", m);

            connection.close();

            connection = getConnection();
View Full Code Here

            connection = getConnection();

            consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            subscriber = consumerSession.createDurableSubscriber(topic, getTestName(), null, true);
            connection.start();
            m = subscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNull("Message should not be received on a new connection", m);
        }
        finally
        {
            consumerSession.unsubscribe(getTestName());
View Full Code Here

            producer.send(createNextMessage(noLocalSession, 1));

            Message m1 = noLocalSubscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNull("Subscriber on nolocal connection should not receive message", m1);

            Message m2 = subscriber.receive(NEGATIVE_RECEIVE_TIMEOUT);
            assertNotNull("Subscriber on non-nolocal connection should receive message", m2);
        }
        finally
        {
            noLocalSession.unsubscribe(noLocalSubId1);
View Full Code Here

         TextMessage tm = (TextMessage)sub1.receive(500);
         ProxyAssertSupport.assertNotNull(tm);
         ProxyAssertSupport.assertEquals("hello", tm.getText());
      }

      Message m = sub2.receive(200);

      ProxyAssertSupport.assertNull(m);

      conn2.start();
View Full Code Here

      conn2.start();

      for (int i = 0; i < NUM_MESSAGES; i++)
      {
         TextMessage tm = (TextMessage)sub2.receive(500);
         ProxyAssertSupport.assertNotNull(tm);
         ProxyAssertSupport.assertEquals("hello", tm.getText());
      }

      log.debug("all messages received by sub2");
View Full Code Here

         publisher.send(om2);

         publisher.send(om3);

         ObjectMessage rm1 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm2 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm3 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);
View Full Code Here

         publisher.send(om3);

         ObjectMessage rm1 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm2 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm3 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ProxyAssertSupport.assertNotNull(rm1);
View Full Code Here

         ObjectMessage rm1 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm2 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ObjectMessage rm3 = (ObjectMessage)sub.receive(HornetQServerTestCase.MAX_TIMEOUT);

         ProxyAssertSupport.assertNotNull(rm1);

         TestObject ro1 = (TestObject)rm1.getObject();
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.