I've got a working solution to my problem but wonder if there is a cleaner way of doing this.
My architecture is composed of several services, emitting messages through a Rabbitmq broker.
Some workers consume those messages and do background jobs.
The thing is that i wanted to be able to create different types of workers, all consuming the same services and be able to have several workers of the same type get the job through round robin.
To do this the messages are published by the service in a pub/sub fashion and consumed by a process that redistribute the messages in a work queue dedicated to a set of workers.
Is there a more elegant manner to do this?
Sorry if the explanation is not clear i'll edit it.
Thanks!
(I could have created one queue per worker in the services but with my solution I can subscribe as much as I want without touching any code)
Sounds like a perfect fit for topic exchange.