Почему SimpleJmsListenerContainerFactory НЕ предоставляет конфигурацию параллелизма? - PullRequest
0 голосов
/ 28 мая 2018

Мы видим, что SimpleMessageListenerContainer имеет свойство с именем concurrentConsumers, но SimpleJmsListenerContainerFactory НЕ поддерживает его настройку.В чем причина?Не рекомендуется использовать параллелизм для SimpleMessageListenerContainer?

1 Ответ

0 голосов
/ 28 мая 2018

Установите параллелизм в аннотации @JmsListener:

/**
 * The concurrency limits for the listener, if any. Overrides the value defined
 * by the container factory used to create the listener container.
 * <p>The concurrency limits can be a "lower-upper" String &mdash; for example,
 * "5-10" &mdash; or a simple upper limit String &mdash; for example, "10", in
 * which case the lower limit will be 1.
 * <p>Note that the underlying container may or may not support all features.
 * For instance, it may not be able to scale, in which case only the upper limit
 * is used.
 */
String concurrency() default "";

Похоже, что Javadocs неверны, хотя

Overrides the value defined
 * by the container factory used to create the listener container.
...