0

We can see SimpleMessageListenerContainer has property named concurrentConsumers, but SimpleJmsListenerContainerFactory did NOT support to config it. What's the root cause? Do not recommend to use concurrency for SimpleMessageListenerContainer ?

Derrick
  • 3,669
  • 5
  • 35
  • 50
Emman Sun
  • 351
  • 3
  • 15

1 Answers1

0

Set the concurrency on the @JmsListener annotation:

/**
 * 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 "";

Looks like the Javadocs are wrong, though

Overrides the value defined
 * by the container factory used to create the listener container.
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Thx @Gary Russell ! I forgot to check this annotation.[JmsListner](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/jms/annotation/JmsListener.html) – Emman Sun May 29 '18 at 00:51