Skip to content

Commit 4cf056c

Browse files
artembilanspring-builds
authored andcommitted
GH-3247: Fix MANUAL ack for null from error handler
Fixes: #3247 When `MANUAL` ack mode and `RabbitListenerErrorHandler` returns `null`, the message is not acknowledged. * Fix `MessagingMessageListenerAdapter.handleException()` to call `basicAck(amqpMessage, channel);` when `isManualAck()` (cherry picked from commit c6519b2)
1 parent de348f6 commit 4cf056c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/adapter/MessagingMessageListenerAdapter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ private void handleException(org.springframework.amqp.core.Message amqpMessage,
191191
handleResult(invResult, amqpMessage, channel, message);
192192
}
193193
else {
194-
logger.trace("Error handler returned no result");
194+
logger.trace("Error handler returned no result; acknowledging the message.");
195+
if (isManualAck()) {
196+
basicAck(amqpMessage, channel);
197+
}
195198
}
196199
}
197200
catch (Exception ex) {

0 commit comments

Comments
 (0)