简体   繁体   English

何时使用 container.setStartConsumerMinInterval(3000) rabbit mq spring boot

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

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我是 spring 引导 amqp 库的新手,在寻找解决方案时,我发现了这个属性。谁能解释一下这个属性的用途

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

See the documnentation查看文档

https://docs.spring.io/spring-amqp/docs/current/reference/html/#startConsumerMinInterval 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).默认值:10000(10 秒)。

https://docs.spring.io/spring-amqp/docs/current/reference/html/#listener-concurrency 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.最简单的是concurrentConsumers ,它创建了(固定)数量的并发处理消息的消费者。

... ...

In addition, a new property called maxConcurrentConsumers has been added and the container dynamically adjusts the concurrency based on workload.此外,还添加了一个名为maxConcurrentConsumers的新属性,容器根据工作负载动态调整并发。 This works in conjunction with four additional properties: consecutiveActiveTrigger , startConsumerMinInterval , consecutiveIdleTrigger , and stopConsumerMinInterval .这与四个附加属性结合使用: stopConsumerMinIntervalstartConsumerMinIntervalconsecutiveIdleTriggerconsecutiveActiveTrigger

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM