When to use container.setStartConsumerMinInterval(3000) rabbit mq spring boot

Viewed 11

I am new to spring boot amqp library,While I am searching for a solution I cam across this property .Can any one explain whats the use of this property

                .createListenerContainer();
container.setStartConsumerMinInterval(3000); ```
1 Answers

See the documnentation

https://docs.spring.io/spring-amqp/docs/current/reference/html/#startConsumerMinInterval

The time in milliseconds that must elapse before each new consumer is started on demand. See Listener Concurrency. Default: 10000 (10 seconds).

https://docs.spring.io/spring-amqp/docs/current/reference/html/#listener-concurrency

By default, the listener container starts a single consumer that receives messages from the queues.

When examining the table in the previous section, you can see a number of properties and attributes that control concurrency. The simplest is concurrentConsumers, which creates that (fixed) number of consumers that concurrently process messages.

...

In addition, a new property called maxConcurrentConsumers has been added and the container dynamically adjusts the concurrency based on workload. This works in conjunction with four additional properties: consecutiveActiveTrigger, startConsumerMinInterval, consecutiveIdleTrigger, and stopConsumerMinInterval.

Related