In a spring boot app, i use JMS with QPID to receive messages from an Azure ServiceBus Queue.
I create my own connection factory with properties:
SessionsAcknownlegdeMode: CLIENT_ACKNOWlEDGE
RedeliveryPolicy Outcome: REJECTED
MaxRedelivery: 5
I use the annotation @JmsListener
Problem: When I consume the message, we try to send a mail with JavaMail
, this normally works but it happened that the smtp server we use was having problem so the org.springframework.mail.MailSendException
was thrown.
The message is correctly retried and put in DLQ after max retries but after a few messages in error, my @JmsListener
method is not invoked for the following messages, and they are put directly in DLQ. That is not what I want.
I tried to replicate this behavior locally by manually throwing exceptions in the listener for given messages, but the consumer correctly sends bad messages to DLQ and consumes good messages.
Does anyone know what is happening ?