Skip to content
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

Issue-298 Consumer is not closed on application shutdown #394

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

sbodvanski
Copy link
Contributor

No description provided.

@@ -486,7 +486,8 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp
// memory and will call handleDelivery for these messages, even if they are re-queued by the broker.
// The client will be unable to acknowledge these messages. So it is safe to silently discard
// them, without bothering the callback handler.
if (!getChannel().isOpen()) {
Copy link
Contributor Author

@sbodvanski sbodvanski Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a chunk of code in the RecoverableConsumerWrapper.cancel() method, which upon receiving the SIGTERM signal, makes sure to finish the processing for the message[s] that have been already delivered to the consumer threads. With this fix, the rest of the queued messages are not going to be pulled from the queue after receiving the SIGTERM signal, and as a result, consumers have been canceled.

@sbodvanski sbodvanski self-assigned this Oct 25, 2022
@sbodvanski
Copy link
Contributor Author

The Static Analysis build tasks failure cuase:

> Task :sonarqube
Checkstyle report not found: /home/runner/work/micronaut-rabbitmq/micronaut-rabbitmq/docs-examples/example-java/build/reports/checkstyle/main.xml

> Task :sonarqube FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants