I am trying to write a utility to list all running nameko RPC services on a host. I am doing ‘rabbitmqctl list_queues’ to get a list of all the running services.
But, I noticed that my rpc-example queue doesn’t get deleted on stopping the ‘example’ service. I am using ‘nameko run’ to start the service and then killing it using ctrl-c.
Is there a timeout in nameko for deleting queues for services that are not running anymore? Or, is it by design that nameko doesn’t delete them?
This is by design – so that services can be stopped without losing any pending messages.
RabbitMQ does support a queue expiry argument, but you can’t provide it to the RPC service queues at the moment. It would be nicer if we exposed that option, and in fact that feature is on the roadmap.
For your use-case of listing running services I think there are better approaches than inspecting the rabbit queues though. You could have all running services periodically ping an endpoint, for example. Or use the Publisher/Consumer extensions to build a survey type message system to contact all running services.
Thank you so much for your reply, Matt. I will explore the survey type message system option.