Glide
Glide

Reputation: 21245

Spring AMQP: How to dynamically adjust the concurrentConsumers?

The Spring AMQP doc says

"Since version 1.3.0, you can now dynamically adjust the concurrentConsumers property."

How do you do that? Thru environment variable or what? Elaborate? Thanks.

Upvotes: 0

Views: 102

Answers (1)

Gary Russell
Gary Russell

Reputation: 174574

Call setConcurrentConsumers() on the listener container...

if (logger.isDebugEnabled()) {
    logger.debug("Changing consumers from " + this.concurrentConsumers + " to " + concurrentConsumers);
}

The number of consumers will be increased or decreased as needed.

Upvotes: 1

Related Questions