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

recovery from channel failure #110

Closed johanneswuerbach closed 1 year ago

johanneswuerbach commented 1 year ago

Add a test case that shows that currently recovery from channel failures isn't working.

If you run it, you will see:

2023/03/06 13:42:55 gorabbit WARN: successfully reconnected to amqp server
2023/03/06 13:42:55 gorabbit INFO: successful recovery from: Exception (405) Reason: "RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'test' in vhost '/'. It could be originally declared on another connection or the exclusive property value does not match that of the original declaration."

But there is actually not connection established to the server.

Related to https://github.com/wagslane/go-rabbitmq/issues/99

johanneswuerbach commented 1 year ago

@wagslane rebased this branch, but also with the latest changes in main, the reconnect test fails.

wagslane commented 1 year ago

@johanneswuerbach Thanks for doing this! If you remove the "skip" line so that it breaks as expected I'll merge this in and I or someone else can work on a fix when we have time

johanneswuerbach commented 1 year ago

Done, I also tried to dig a bit, but haven't found the issue yet.