I'm trying to use single active consumer (SAC) in queues bounded to consistent hash exchange, which has 4 queues. This is for distributing the messages based on routing key and to have ordered processing in each of the queues.
Have set an Executor thread pool with 4 thread in TaskExecutor while creating Spring SimpleMessageListenerContainer, assuming to have one consumer thread per queue.
simpleContainer.setTaskExecutor(Executors.newFixedThreadPool(4));
When testing, there is only one thread is consuming from all the 4 queues, rarely two threads consume messages from the 4 queues. Which is like having a single consumer consumes from multiple queues.
What I need is to have a consumer thread consume from only one queue at a time, with SAC enabled. In this case I expect 4 threads from the thread pool consume from one queue each. Is there a way to achieve this?.