Examples of receiveNoWait()


Examples of javax.jms.MessageConsumer.receiveNoWait()

            ProxyAssertSupport.assertEquals("john", m.getStringProperty("beatle"));
           
            log.info("Got message " + j);
         }

         Message m = cons1.receiveNoWait();

         ProxyAssertSupport.assertNull(m);

         String selector2 = "beatle = 'kermit the frog'";
View Full Code Here

Examples of javax.jms.MessageConsumer.receiveNoWait()

            ProxyAssertSupport.assertNotNull(m);

            ProxyAssertSupport.assertEquals("john", m.getStringProperty("beatle"));
         }

         Message m = cons1.receiveNoWait();

         ProxyAssertSupport.assertNull(m);

         String selector2 = "beatle = 'kermit the frog'";
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

           * The first queue entry shall be deleted after writing it
           * to the DeletedMessageStore, because the OnError
           * resolution is Delete
           */
          QueueReceiver receiver = getReceiver(mDeleteQueue);
          Message message = receiver.receiveNoWait();
          if (message.getJMSMessageID().equals(mDeleteMessageId)
              && DeletedMessageStore.getInstance().writeMessage()) {
            mSession.commit();
          } else {
            mSession.rollback();
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         message = session.createTextMessage("OK");
         sender.send(message);

         // Try to receive the message the not expired message
         queueConnection.start();
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
      }
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         queueConnection.start();
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
      }
      finally
      {
         disconnect();
      }
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         message = session.createTextMessage("OK");
         sender.send(message);
         // Sleep 6 seconds
         Thread.sleep(6*1000);
         // Try to receive the OK message
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);

View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         // Try to receive the OK message
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);

         // Send a message that expires in 10 seconds
         message = session.createTextMessage("10 Second Expiration");
         sender.send(message, DeliveryMode.PERSISTENT, 4, 10*1000);
         // Send a message that has not expired
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         message = session.createTextMessage("OK");
         sender.send(message);
         // Sleep 1 seconds
         Thread.sleep(1*1000);
         // Try to receive the messages
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("10 Second Expiration", message.getText());
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         // Sleep 1 seconds
         Thread.sleep(1*1000);
         // Try to receive the messages
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("10 Second Expiration", message.getText());
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
        
View Full Code Here

Examples of javax.jms.QueueReceiver.receiveNoWait()

         assertEquals("10 Second Expiration", message.getText());
         message = (TextMessage) receiver.receiveNoWait();
         assertEquals("OK", message.getText());

         // Should be no more
         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
        
         // Test that JMSExpiration has no affect
         message = session.createTextMessage("5 Second Expiration");
         message.setJMSExpiration(System.currentTimeMillis() + 5*1000);
         sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
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.