1 Reply Latest reply on Feb 25, 2005 5:27 PM by Adrian Brock

    where goes msg, if the only queue consumer client does not a

    Dieter Cailliau Newbie

      I don't understand what happens, if a queue-consumer does not ack a message, if the session is client_acknowledge.

      I would think there is some kind of timeout, after which the message is considered "lost" + a resending to one of the queue's consumers? If you throw an exception in a message consumer, is the mesage explicitely "unacknowledged" (so that another consumer can stat consuming it)?

      I ran into this problem while setting up jms over http. Say i have a jms server with an outgoing queue, and a remote client program, consuming messages from that queue.

      When i boot the client, it starts consuming. After i killed and restarted the client, the server doesn't immediately notice. At least one message is never send to the "new" client. Though when i reboot the jms server (and the client), that one message finally reaches the client.

      So it looks like the jms has chosen the dead client, to process that message. Since that client doesn't exists, the message is never ack'ed, and rebooting the jms forces the message to be redelivered.

      I wonder how i can work arround this. I do not want to reboot the server every time a client goes down (which is impossible, because the server doesn't know when this client goes down).

      -- resuming my test scenario:

      I set up a jms server on machine S holding queue Q.
      I post a message to queue Q.

      I start a client on machine C.
      The client consumes from Q, and receives and acks the message.
      I kill the client process (it does not un-register with the queue).

      I post a message to queue Q.

      I start a client on machine C.
      This message is NOT received.
      I kill the client process.

      I reboot the jms server jboss.
      I start the client.
      Now the message is received by the client.

        • 1. Re: where goes msg, if the only queue consumer client does n
          Adrian Brock Master

          The default timeout the JBossMQ Server uses before it assumes a client is dead
          is 2 minutes. See the read timeout setting in uil2-service.xml

          When a client dies, JBossMQ will nack all the unacknowledged messages.

          As I have said so many times in these forums....
          Throwing an Exception from a MessageListener is not allowed by the JMS spec.
          On JBoss it will result in the message being dropped (positive acknowledgement).

          For a demonstration of the client acknowledge behaviour, see the example on the WIKI.