go-rabbitmq: Consumer won't reconnect
Hi,
Somehow when network got disconnected for a minutes or so and then network up again, I got a log
gorabbit: rabbit consumer goroutine closed
After that, consumer stops receiving new message. Why wont it reconnect?
I’m using version 0.6.2, and my code is (more or less) like this
rabbitmqConsumer, err := rabbitmq.NewConsumer(config.constructURL(), amqp.Config{}, rabbitmq.WithConsumerOptionsLogging)
...
rabbitmqConsumer.StartConsuming(
func(message rabbitmq.Delivery) bool {
return true
},
"",
[]string{""},
func(options *rabbitmq.ConsumeOptions) {
options.QueueExclusive = true
options.ConsumerExclusive = true
options.QueueDurable = true
options.BindingExchange = &rabbitmq.BindingExchangeOptions{
Name: "my_rabbitmq_topic",
Kind: "fanout",
Durable: true,
}
},
)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 31 (16 by maintainers)
Note that this is not my use case. My case is:
gorabbit: rabbit consumer goroutine closedin the consumer logSo it seems like the consumer gets bored and drops the connection and does not reconnect.