Try using ReceiveNoWait or Receive with the time span. Receive() is ment to block until a message arrives.
On 10/23/06, robottaway <[EMAIL PROTECTED]> wrote:
I am guessing that the Recieve function on the ActiveMQ message consumer in the NMS api should return null when no messages are on a queue. I am not seeing this. I try to check for messages after receive, making sure that they are not null. What happens is that execution stops at the consumer.Receive() call, and does not move forward until a message comes into the queue. What I am trying to do is the following: I have a windows service that will consume messages from a queue. When it starts up I want to try and read all messages on the queue. Once the initial messages are done being read I want to have the consumer stop, and another consumer with a MessageListener takes over. I register the MessageListener on another consumer so that any new messages that come into the queue will be read asynchronously. I can make one or the other work, but not both. This is because the Receive function does not return when there are no messages on the queue I am reading from. -- View this message in context: http://www.nabble.com/NMS-C--client-Recieve-not-timing-out-tf2497328.html#a6961449 Sent from the ActiveMQ - User mailing list archive at Nabble.com.
-- Regards, Hiram Blog: http://hiramchirino.com
