I noticed that SimpleMessageListenerContainer has a property - concurrentConsumers; I use it to setting the count of concurrent consumers:
My question is, how can i dynamic adjusting the instance count of concurrentConsumers that based on queue depth(total count of message remaining in the queue)? when depth of aQueue is large, increasing the count of concurrentConsumers; when its small, decreasing it.Code:<rabbit:listener-container connection-factory="connectionFactory" message-converter="jsonMessageConverter" concurrency="5" > <rabbit:listener queues="aQueue" ref="messageConsumer" method="handleMessage" /> </rabbit:listener-container>
Besides:how can i get queue depth using spring-amqp API?
All reply will be appreciated.