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
772 stars 126 forks source link

Allow consumers to disable declaration of queue #52

Closed miketonks closed 2 years ago

miketonks commented 2 years ago

I'm running into an error running the consumer in our uat and production environments.

021/11/30 12:12:17 gorabbit: attempting to reconnect to amqp server after close 2021/11/30 12:12:17 gorabbit: waiting 1s seconds to attempt to reconnect to amqp server 2021/11/30 12:12:17 Failed to consume: %sException (403) Reason: "ACCESS_REFUSED - access to queue '*' in vhost '' refused for user '**'" exit status 1

Rabbit server is managed by another team and looks like we don't have permissions to declare queue. I can consume fine with same credentials using raw amqp library, but cannot declare a queue.

Feels like this should be optional.

I noticed the following PR which looks like it should solve the issue: https://github.com/wagslane/go-rabbitmq/pull/49

miketonks commented 2 years ago

I tested @TomBrouws patch locally and works for me :)

wagslane commented 2 years ago

resolved in #49