MQ Message not acknowledged on thrown exception
See original GitHub issueDescribe the bug I am using artemis mq as a message broker and have an incoming stream to listen for messages on a queue. In the method for the incoming stream, I have it possible to throw an exception. It seems that if an exception is thrown the mq broker is not notified that the message has been acknowledged by my service even though I have received and processed it. My service will no longer receive any messages sent to the queue and every time I restart my service, it receives that same bad message. If I change the method to just log the error, the queue works normally and is able to receive the bad message, log it, and continue receiving messages.
Expected behavior Throws exception but continues listening for future messages on that queue.
Actual behavior Throws exception and no longer receives messages on that queue.
To Reproduce Steps to reproduce the behavior:
- Start up mq broker
- Create method with incoming tag to receive messages on a queue
- Throw exception in method
- Send data that causes exception to be thrown
- Send data again
Configuration
# Add your application.properties here, if applicable.
mp.messaging.incoming.queue-name.connector=smallrye-amqp
mp.messaging.incoming.queue-name.durable=true
Environment (please complete the following information):
- Output of
uname -a
orver
: - Output of
java -version
: 11.0.2 - GraalVM version (if different from Java):
- Quarkus version or git rev: 0.28.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Hmm, apparently I was wrong. Modified
mqtt-quickstart
to look more like my code with aonErrorResumeWith
and aPublisherBuilder
. Replacing theprocess
-method inPriceConverter
with the following:Running showed no issues. Sending incorrect messages did not disturb further processing of correct messages.
My failing server was actually using a
ProcessorBuilder
instead of aPublisherBuilder
. So after changing it toPublisherBuilder
it worked again as expected. I don’t know what exactly I did wrong in the original situation. So next I used aProcessorBuilder
for the quickstart as well. Replacing theprocess
-method inPriceConverter
with the following give the same faulty behaviour:Fixed in 1.6 thanks to the reactive messaging update.