wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
805 stars 128 forks source link

Graceful shutdown #78

Closed SrikanthBhandary closed 2 years ago

SrikanthBhandary commented 2 years ago

Currently all the messages which are processing will be re-enqueued during the interruption.

wagslane commented 2 years ago

Correct! That is by design.

vvayne676 commented 10 months ago

Hi @wagslane, when I call consumer.Close(), it will shutdown the consumer at once and throw processing message back to queue? If that so, is there a way to shutdown the consumer after it processed all the processing messages?

johanneswuerbach commented 10 months ago

FYI: There is a proposed change for exactly this https://github.com/wagslane/go-rabbitmq/pull/150