Lupidon
Lupidon

Reputation: 619

Is there a way to update the number of concurrency in ConcurrentMessageListenerContainer?

I developing an application which using the spring-kafka package and changing the amount of data it handled in run time.
I want to let the system the ability to change in run time the number of concurrency depend on the pressure the system feel (something that I will defined).
Right now the my solution is to doStop and doStart the ConcurrentMessageListenerContainer explicitly but I look for a clean way which not damage the stream and not touch an internal methods of the ConcurrentMessageListenerContainer explicitly

Upvotes: 1

Views: 303

Answers (1)

Gary Russell
Gary Russell

Reputation: 174739

You don't need to interact with these internal methods; use stop() and start(), which are public, instead.

You cannot change the concurrency dynamically, only by stopping and starting the container, changing the concurrency while stopped.

Upvotes: 1

Related Questions