jondot/sneakers

Allow a worker to work on an existing queue without specifying an exchange

BenTalagan opened this issue · 2 comments

Sneakers currently does not allow to work on an already existing queue, without dealing with the exchange it belongs to first (thus the exchange will be either used if it does already exist or it will be created), see queue.rb.

But for authorization reasons, it could be nice to be able to create the channel, and use the queue directly if it exists. It is normally legit to have a user with minimum rights (read on an existing queue dedicated for him/here) without having to mess with the exchange (the user may have no rights at all on the exchange, only on the queue). Seems to me that sneakers does not allow to work in that specific configuration. Maybe if no exchange is passed to the worker/queue configuration, sneakers could try to skip the exchange phase and work directly with the queue ?

Thanks for making a feature request! This is a reasonable ask. Do think you could throw together a PR?

Sure! Really minimalist, though, but hope it helps: #401.