Auto delete get rids of the q and the messages.
Any custom hook, or anyway to know besides a different watcher process when all subscribers got disconnected?
Ive found a decent solution - as im under kubernetes, ill make each shard a stateful set deployment, where the first pod is responsible in handling the queue.
When the pod X-0 is created, ill create the queue, bind it to the exchange (consistent hash) and thats it.
When the deployment needs to be removed, ill run a drainer pod - and use this:
https://medium.com/@marko.luksa/graceful-scaledown-of-stateful-apps-in-kubernetes-2205fc556ba9
Then ill unbind the queue, move the msgs away back to the exchange, and delete the q.