Package javax.jms

Examples of javax.jms.TopicSubscriber.receiveNoWait()


            msg = tsub.receiveNoWait();
            Assert.assertNotNull("third message", msg);
            Assert.assertEquals("third message", new Integer(1004),
                                            ((ObjectMessage)msg).getObject());
            msg = tsub.receiveNoWait();
            Assert.assertNotNull("fourth message", msg);
            Assert.assertEquals("fourth message", new Integer(1005),
                                            ((ObjectMessage)msg).getObject());

            ts.unsubscribe(name);
View Full Code Here


            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);

            tsub = ts.createDurableSubscriber(topic, name);

            msg = tsub.receiveNoWait();
            Assert.assertNull("after unsubscription", msg);

            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);
View Full Code Here

            Assert.assertNull("after unsubscription", msg);

            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);

            msg = tsub.receiveNoWait();
            Assert.assertNotNull("fith message", msg);
            Assert.assertEquals("fith message", new Integer(1008),
                                            ((ObjectMessage)msg).getObject());

            ts.unsubscribe(name);
View Full Code Here

      //send it back
      sender2.publish(msg);

      msg = (TextMessage) subscriber1.receive(2000);
      assertTrue("Subscriber1 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
      assertTrue("Subscriber2 should not get a message", subscriber2.receiveNoWait() == null);

      topicConnection1.stop();
      topicConnection1.close();
      topicConnection2.stop();
      topicConnection2.close();
View Full Code Here

         resource.rollback(xid1);

         xid1 = new MyXid();
         resource.start(xid1, XAResource.TMNOFLAGS);
         // Receive the message using "AutoAcknowledge"
         message = subscriber.receiveNoWait();
         if (message == null)
            fail("No message after rollback?");
         resource.commit(xid1, true);

      }
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.