activemq-nms-amqp icon indicating copy to clipboard operation
activemq-nms-amqp copied to clipboard

Implement redelivery policy.

Open stevemuk opened this issue 3 years ago • 15 comments

When setting a RedeliveryPolicy only the MaximumRedeliveries is honoured, RedeliveryDelay is neither calculated nor applied so retries are immediate rather than backing off. Secondly messages that fail to be processed are marked as MODIFIED_FAILED_UNDELIVERABLE rather than REJECTED, which leaves them on the queue until either they expire or the session is restarted.

This change will apply a RedeliveryDelay on retry and mark messages that exceed MaximumRedeliveries as REJECTED. I have tested this with AMQ Artemis and added unit tests.

stevemuk avatar Jul 27 '22 12:07 stevemuk

I believe the NMS AMQP folks were basing their behaviour here on Qpid JMS like much of the code, in which case the MODIFIED_FAILED_UNDELIVERABLE (shorthand for undeliverable-here) is the expected and intended behaviour. Rejected has a particular meaning in the protocol that the underlying message is invalid, which means it is usually not the approripriate choice for simple 'nacking' (though annoyingly uses the more-obvious name).

Qpid JMS does have the ability to configured the outcome used, meaning it can be asked to do something else instead such as rejected if desired, I dont know if the NMS client does.

Youll need to raise a JIRA and update your commit to reference it (e.g see most prior commits). As you appear to be doing 2 seperate things you should probably have separate JIRAs and commits.

gemmellr avatar Jul 28 '22 12:07 gemmellr

Hi @stevemuk, Thanks for your contribution. I will take a look at it over the weekend.

Havret avatar Aug 09 '22 06:08 Havret

Besides what Robbie said, here are my two cents.

Regarding making the Outcome configurable are you happy for an extension to the NMS RedeliveryPolicy class to include a new Outcome property?

stevemuk avatar Aug 16 '22 07:08 stevemuk

Any idea when this pull request will be merged ?

YoannDiguet avatar Oct 26 '22 14:10 YoannDiguet

@stevemuk would you please rebase and squash down to one commit?

edit: tag the author

mattrpav avatar Oct 26 '22 14:10 mattrpav

Squashing the commits isnt the holdup, and it is also someone elses PR.

The PR hasnt been merged as it simply isnt finished. The feeback I gave in July, around the original behaviour being intended, and the new behaviour implemented here for 'rejecting' actually being the wrong thing to do by default, wasnt yet actioned. Thats seemingly as an answer wasnt given to a question, one I dont know the answer to and so didnt answer.

gemmellr avatar Oct 26 '22 14:10 gemmellr

Thats seemingly as an answer wasnt given to a question, one I dont know the answer to and so didnt answer.

Care to clarify-- specifically, what action or steps need to be taken for a +1?

mattrpav avatar Oct 26 '22 15:10 mattrpav

The first comment: https://github.com/apache/activemq-nms-amqp/pull/83#issuecomment-1198049883 The last comment prior to todays question: https://github.com/apache/activemq-nms-amqp/pull/83#issuecomment-1216244962

gemmellr avatar Oct 26 '22 15:10 gemmellr

Just for your information, I was just trying to use this lib in my project at work and I needed the retry feature. As it behaved strangely during my tests, I started to look around and found out this pull request. It seems to do what I wanted, but honestly, I don't know what I could do to help you on this as I don't know enough about the code in this repository... Anyway, thank you for your quick response :-)

YoannDiguet avatar Oct 26 '22 15:10 YoannDiguet

Can confirm this works a lot better for individual ack. When using the main branch of this library, MaximumRedeliveries is respected, but messages are never sent to a dlq (and not marked as redelivered in the console, but i'm not sure if that is related). When using this pull request, the messages are put on a dlq when maximumredeliveries is reached

Jefwillems avatar Feb 16 '23 09:02 Jefwillems

any help needed here ? Are we waiting for @Havret changes to be made ?

arkiaconsulting avatar Sep 26 '23 14:09 arkiaconsulting

It's waiting on responses and corrections that Robbie previously highlighted. Robbie re called out those last yr on the 26 Oct 2022 https://github.com/apache/activemq-nms-amqp/pull/83#issuecomment-1292203011

With no changes, or responses to address those, the state of the pr hasn't changed

michaelandrepearce avatar Oct 03 '23 22:10 michaelandrepearce