jondot / sneakers

A fast background processing framework for Ruby and RabbitMQ
https://github.com/jondot/sneakers
MIT License
2.25k stars 331 forks source link

support multiple exchanges for queue #387

Closed stevereinke closed 5 years ago

stevereinke commented 5 years ago

Hi there,

in our project we tried to use two delivery strategies for one queue. We want to connect our queue to a exchange of type direct and to another exchange of type fanout. So we changed the subscrive method of the queue object to support multiple exchanges. Please have a look at the code and merge it if it's fine. ;-)

Kind regards, Steve

michaelklishin commented 5 years ago

Thank you for your time and interest in contributing!

The number of small features that control the topology is getting out of hand. Sneakers cannot accommodate every possible scenario and adding more and more features in this are is not sustainable.

I recommend setting it up with Bunny instead (Bunny connection and channel should be exposed via the API). I'd prefer to see more interest in this feature before we merge it.

michaelklishin commented 5 years ago

@Tensho havee you encounters similar scenarios? Is there anything that would make it hard[er] to use Bunny directly to set up the topology? I'd rather work on fixing that then adding more and more topology definition features.

Tensho commented 5 years ago

@michaelklishin, my sentiments the same – I used to consider sneakers in a worker queue scenario mostly. Despite I don't recommend to go this way either, it's possible to control more complex topologies with the different Sneakers::Worker definitions. TBH, I have never seen the need to bind multiple exchanges to one queue, only vice versa bindings.