----- "cronos" <[EMAIL PROTECTED]> wrote:
...
> It is expected AMQ 4.1.1 behaviour that the client MUST wait until a
> message
> arrives in the queue 
> before disconnecting? Any help appreciated.


  The behavior you are seeing is expected.  You should not try to read another 
Stomp frame if you don't want read another message.  But if you don't want to 
wait for a message, don't.

  If you simply want to see if there are any more messages, you should probably 
just use a timeout, or do a test for data waiting on the socket.

  Now, I would expect there is some delay between the SUBSCRIBE, and for the 
first waiting message to be sent to your socket, so I think a read with a 
timeout would best.  If you get a timeout with no data, you should just send a 
DISCONNECT and close.

  You should use client-acked messages of course, because otherwise there is a 
window after you get a timeout, and when you close the the socket, that a 
message could be sent to your socket that you would just toss.  But with 
client-acked messages, the message would be re-delivered on the next connection 
to broker.


Tom

Reply via email to