Package javax.jms

Examples of javax.jms.QueueReceiver.receive()


            QueueSender sender = session.createSender(queue);
            sender.send(message);

            QueueReceiver receiver = session.createReceiver(temp);
            if (receiver.receive(2000) == null)
            {
               state.addError(new Exception("Didn't receive message"));
            }
            receiver.close();
            temp.delete();
View Full Code Here


            TopicPublisher publisher = session.createPublisher(topic);
            publisher.publish(message);

            QueueReceiver receiver = qsession.createReceiver(temp);
            if (receiver.receive(2000) == null)
            {
               state.addError(new Exception("Didn't receive message"));
            }
            receiver.close();
           
View Full Code Here

            Session.AUTO_ACKNOWLEDGE);
      Queue queue = (Queue) context.lookup(name);

      QueueReceiver receiver = session.createReceiver(queue);
      queueConnection.start();
      Message message = receiver.receive(50);
      int c = 0;
      while (message != null)
      {
         message = receiver.receive(50);
         c++;
View Full Code Here

      queueConnection.start();
      Message message = receiver.receive(50);
      int c = 0;
      while (message != null)
      {
         message = receiver.receive(50);
         c++;
      }

      if (c != 0)
         getLog().debug("  Drained " + c + " messages from the queue");
View Full Code Here

               if (sendCount <= target)
               {
                  for (int i = 0; i < 10 && ++sendCount <= target; ++i)
                     sender.send(message);
               }
               if (receiver.receive(1) != null)
                  ++count;
            }
         }
         finally
         {
View Full Code Here

        
         session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
         sender = session.createSender(queueA);
         receiver = session.createReceiver(queueB);

         while (receiver.receive(1000) != null)
         {
            // Empty the queue
         }

         TextMessage message = session.createTextMessage();
View Full Code Here

         message.setIntProperty("UNIQUE_ID", 123456789);
         message.setJMSReplyTo(queueB);
         sender.send(message);

         // Get the initial onMessage ack
         Message reply = receiver.receive(30000);
         log.info("onMessage reply: " + reply);
         assertTrue("onMessage reply != null", reply != null);

         if (log.isDebugEnabled())
         {
View Full Code Here

         int id = reply.getIntProperty("UNIQUE_ID");
         log.debug("id=" + id);
         assertTrue("onMessage reply.id = 123456789", id == 123456789);

         // Get the initial timer reply
         reply = receiver.receive(30000);
         log.info("ejbTimeout reply: " + reply);
         assertTrue("ejbTimeout reply != null", reply != null);

         if (log.isDebugEnabled())
         {
View Full Code Here

         session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
         sender = session.createSender(queueA);
         receiver = session.createReceiver(queueB);

         while (receiver.receive(1000) != null)
         {
            // Empty the queue
         }

         TextMessage message = session.createTextMessage();
View Full Code Here

         message.setIntProperty("UNIQUE_ID", 123456788);
         message.setJMSReplyTo(queueB);
         sender.send(message);

         // Get the initial onMessage ack
         Message reply = receiver.receive(15000);
         log.info("onMessage reply: " + reply);
         assertTrue("onMessage reply != null", reply != null);
         int id = reply.getIntProperty("UNIQUE_ID");
         assertTrue("onMessage reply.id = 123456788", id == 123456788);
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.