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
785 stars 128 forks source link

Add cluster support via Resolver #156

Closed nemith closed 6 months ago

nemith commented 6 months ago

This adds support for RabbitMQ clusters to connect up to one of a number of servers.

It does this through a Resolver interface which has a single method called Resolve() which can return a list of servers. There is a standard implementation included called StaticResolver that will just take a list of URLS to connect to and optionally shuffle that list.

This interface approach allows for implementers of the library to extend for service discovery or other advanced typologies.

Fixes: #148

nemith commented 6 months ago

I went ahead and wrote my own wrapper that has this and does things slightly different. No longer have a strong requirement for this.