quarkiverse / quarkus-artemis

Quarkus Artemis extensions
Apache License 2.0
12 stars 12 forks source link

Quarkus Artemis Jms library does not deliver message to dead-letter-queue on Artemis MQ #571

Closed joe-specimen closed 2 months ago

joe-specimen commented 2 months ago

Hello all,

I have a problem when using "quarkus-artemis-jms" library. The story goes a little bit like:

I am currently implementing inside a Quarkus project a JMS consumer which listens to a anycast queue ("my.edu.queue") on Artemis MQ (version 2.32.0). What I want to test is how the message is delivered to dead-letter queue if let's say some business error happens. I simulated the business error for every fifth message (just throw exception).

From the looks at the code from Artemis examples (dead-letter example) the code for dead-letter seems straight forward. I have implemented the functionality in the same way as it is in the Artemis example (as I thought), except that I have done it with "quarkus-artemis-jms" library. The problem with the code or maybe my Artemis setup is that I do not get message inside dead letter queue when I do Session.rollback(). The code of my JmsMessageConsumer can be found on my github repo here. I have also set the max-delivery-attempts inside broker.xml to 0 for my queue (I have added link to my project where every file is in there).

The whole project (which is really simple) with all the configuration files can be found here. The broker.xml which I use for my Artemis can be found inside src/resources/broker_conf/broker.xml

I have also posted this question on stackoverflow here

Can somebody help me with the problem? If this is not the correct place to ask such questions then can anybody please guide me where I somebody could help me.

joe-specimen commented 2 months ago

I have already got the answer what was wrong. I thought that the max-delivery-attempts should be put to 0 for no redelivery to happen, but instead it should be put to 1 and now when I changed this in my broker.xml it works. Thanks and sorry for bothering you. The answer can be found here

middagj commented 2 months ago

Thanks for getting back to us with the solution.