-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The SimpleMessageListenerContainer
does not shutdown properly
#2593
Comments
Fixes: #2593 * Add `activeObjectCounter` release into the `BlockingQueueConsumer.handleCancelOk()` in reply to the `basicCancel()` call * Adjust `BlockingQueueConsumer.basicCancel()` to call `RabbitUtils.closeMessageConsumer()` to setisfy transactional context * Adjust `SimpleMessageListenerContainerIntegrationTests` to eventually setisfy to the transaction rollback when container is shuted down * Add new tests into the `ContainerShutDownTests` to verify the listener containers are not blocked waiting on the `cancelationLock` **Cherry-pick to `3.0.x`** (cherry picked from commit 70ba65f)
@artembilan I'm trying to understand the commit 37d9641#diff-537549efc15fbf10a5941ac7f1a8648a24ffc56cccc7c46f190ccff45351b44b and I'm worried that it might not work because if a consumer is cancelled, the mainLoop() will not be executed and no chance to release itself?
|
I think you mean like this:
after that Please, confirm that we are on the same page, and I'll provide the fix shortly. |
@artembilan |
BTW, @haloxinyu , we have just released version |
@artembilan |
We can see that from logs when we close an application normally:
Pay attention to
5 sec
delay betweenWaiting for workers to finish.
andWorkers not finished.
.This is reported by the code in the
SimpleMessageListenerContainer
:So, the
cancellationLock
is not released from a consumer which has just reportedReceived cancelOk for tag
.The
BlockingQueueConsumer
must be fixed in itshandleCancelOk()
to add:NOTE: the
DirectMessageListenerContainer
already has such a logic:which is called from the mentioned
handleCancelOk()
.The text was updated successfully, but these errors were encountered: