1 Reply Latest reply on Jan 21, 2009 9:40 PM by gaohoward

    Stranges with message reading from queue

      Hello

      I have question about receiveNoWait method. When I use it, it always returns null
      if I use this code: consumer.receive(2000) - everything is ok. I receive message.
      BUT
      if I use this code: consumer.receiveNoWait() - I do not receive any messages,

      My program must check queue periodically, using quartz - so I don;t want to block process pointing any time to receive()

      How can I make receiveNoWait() to return messages?

      thanks

        • 1. Re: Stranges with message reading from queue
          gaohoward

          Hi, the receiveNoWait means it doesn't wait until a message is received. You can't expect it will get something every time you called it. If you can get a message by receive(2000), try to replace it with sleeping 2000 ms and call receiveNoWait(). I bet you will get the messages.