Behaviour of forceStop
when mid-processing
#2800
Replies: 1 comment 1 reply
-
Hi, @izaak-birchall-landbay ! Any chances that you can share with us a simple project to reproduce on our side?
where the code is like this:
So, we are supposed to be done with the current message before entering that Sounds like there is some race condition between ack and close, where the last one is performed on the channel faster, than the first one. I would like to understand how you are ack'ing. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hello,
We are seeing dual message consumption issues intermittently when a message is being processed at application shutdown.
We see the following behaviour...
SimpleMessageListenerContainer#shutdownOrWaitAndCallback
as we are using the defaultforceStop = false
[bbit.connection.CachingConnectionFactory]: Shutdown Signal: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 156, class-id=60, method-id=80)
I understand this is the expected behaviour when
forceStop
is set tofalse
. (https://docs.spring.io/spring-amqp/reference/amqp/containerAttributes.html#forceStop) and is a part of best effort 1PC when there is a failure in publishing the message.I tested the same flow with
forceStop = true
.I expected to see that the message would be successfully processed, and would not be requeued, meaning no duplicate consumption.
I observed...
PRECONDITION_FAILED
log line was not produced as the channel was still open when the consumer ACKed the messageMy confusion is around point 3. It does not make sense to me to requeue a message that we have ACKed. It would make more sense for me to requeue any messages that...
Is there a way to achieve the behaviour I am looking for, where ACKed messages are not requeued with
forceStop = true
at application shutdown? Is this even something I would want to do? (Perhaps I have missed a downfall of this behaviour)Beta Was this translation helpful? Give feedback.
All reactions