Hi Kim,

I ran a test using MessageListener with CLIENT_ACKNOWLEDGE and it works as
expected.
I verified using logging that the message accept command is only sent if I
call message.acknowledge() or session.acknowledge().

Between how did you verify that the messages are acked ? is it using logs or
using mgt tools ?

However if I don't ack the messages and close the consumer, then another
consumer should be getting the messages with the redelivered flag set.
But in my testing it seems that the broker is not redelivering the messages.
I will investigate this tomorrow and get back to you.

Regards,

Rajith

On Mon, Mar 7, 2011 at 12:41 PM, Kim Garcia <[email protected]> wrote:

>
> Hello All,
>
> I am trying to set up a ring queue in which multiple clients will want to
> read the same messages. I set up my session as CLIENT_ACKNOWLEDGE, so that I
> will need to manually acknowledge the message (although I never intend to
> due to the multiple clients). I would like to use a MessageListener to be
> notified every time a new message arrives on the queue. So when onMessage()
> is called, I process the message, but then when onMessage() returns, it
> automatically acknowledges the messge. The problem is that once the message
> is acknowledged, the message will be thrown away and the other clients won't
> be able to get the message.
>
> Is it possible to use the MessageListener to monitor the queue and call
> onMessage() to process the messages --- but NOT acknowledge the message?
>
> Thank you.

Reply via email to