On 06/02/2018 07:41 AM, jo.stenb...@offilive.com wrote:
Hi,

we are using the qpid-jms client with Artemis 2.6. I am having big troubles 
getting message rejection/redelivery working as expected. I already opened an 
issue against Artemis https://issues.apache.org/jira/browse/ARTEMIS-1618  
(https://issues.apache.org/jira/browse/ARTEMIS-1618)but the more I play around 
with my test case the more I wonder if it may be an issue in qpid-jms itself.

What I am basically looking for is to consume messages with a MessageListener 
where in case of an unexpected error during message processing the onMessage() 
method throws a runtime exception that eventually signals to the broker that 
the message was not acknowledged. The broker then should try to redeliver the 
message 3 times and then put it into a pre-configured DLQ.

I played around with all kind combination of session modes incl. qpid-jms 
specific ones and different qpid-jms redeliveryPolicy settings but I am not 
getting any further. For example when I set the session mode to 
AUTO_ACKNOWLEDGE in qpid-jms, the message seems to be redelivered locally 
indefinitely. When I use any other session mode the message is not consumed a 
second time.

The Artemis JIRA issue contains a simple unit test case that can be used to 
easily reproduce the problem I am having. 
https://issues.apache.org/jira/secure/attachment/12926230/Artemis1618_AmqpDeadLettering_Test.java
 
(https://issues.apache.org/jira/secure/attachment/12926230/Artemis1618_AmqpDeadLettering_Test.java)

I would really appreciate if someone could have a look at it and give me a hint 
on whether this looks like a bug/limitation in qpid-jms, or if I am doing 
something completely wrong, or if it seems to be a broker implementation issue.

Thanks!

Regards,
Johan

The JMS specification defines that an exception thrown from onMessage is a programming error, so I'd say first thing to do is not do that any more and go from there.  The behavior you want sounds like a good candidate for a transacted Session with configuration on the redelivery policy that controls how many deliveries to allow before the message is no longer allowed to be redelivered.

Documentation on the redelivery policy for the Qpid JMS client is here.

http://qpid.apache.org/releases/qpid-jms-0.32.0/docs/index.html#jms-configuration-options


--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to