I'm trying to implement the Worker pattern using the Spring AMQP API and not making much headway.
Very simply, I want a queue like this:
Client sends a request -> Exchange -> routed to single Queue 'Q1'
Several Worker 'handlers' should peel off the requests from the queue and 'handle' them. Since the handling can take time, we want that the requests to be handled by the next available worker. So if a free worker is available, then the request is handled immediately, else it waits for a worker to get free.
Using the Spring AMQP API, I'm thinking I should set up a SimpleMessageListenerContainer on the 'Worker' side. However, that container only allows me to set one 'Listener' on it.
How can I make is so that I can have a variable number of listeners and that they are cycled as described above?
Thanks in advance!