0x4b53 / amqp-rpc

🐰 Framework to use RabbitMQ as RPC
MIT License
45 stars 8 forks source link

Add and remove queue bindings while runing #105

Open liviumanea opened 1 year ago

liviumanea commented 1 year ago

How would I go about dinamically adding or removing queue bindings after the client has started ?

bombsimon commented 1 year ago

Hey!

This is sadly not supported currently. Here is where we start consuming from all the bindings which is only invoked when calling ListenAndServe.

Depending on your setup a workaround could be to bind a new binding and then call Stop followed by Start. Stop will drain incoming requests and finish process any in flight request so it should be graceful, however it's obviously not ideal.

If we move the consumer tags so we can access them in cancelConsumers (maybe move that function to an associate function on the server) we could easily add and start (and stop) consuming on bindings dynamically at runtime.

PRs welcome!