@@ -337,9 +337,10 @@ public final int getConcurrentConsumers() {
337
337
* to scale the consumption of messages coming in from a queue. However,
338
338
* note that any ordering guarantees are lost once multiple consumers are
339
339
* registered. In general, stick with 1 consumer for low-volume queues.
340
- * <p><b>Do not raise the number of concurrent consumers for a topic.</b>
341
- * This would lead to concurrent consumption of the same message,
342
- * which is hardly ever desirable.
340
+ * <p><b>Do not raise the number of concurrent consumers for a topic,
341
+ * unless vendor-specific setup measures clearly allow for it.</b>
342
+ * With regular setup, this would lead to concurrent consumption
343
+ * of the same message, which is hardly ever desirable.
343
344
* <p><b>This setting can be modified at runtime, for example through JMX.</b>
344
345
* @see #setConcurrentConsumers
345
346
*/
@@ -526,13 +527,19 @@ protected void doShutdown() throws JMSException {
526
527
logger .debug ("Waiting for shutdown of message listener invokers" );
527
528
try {
528
529
synchronized (this .lifecycleMonitor ) {
530
+ // Waiting for AsyncMessageListenerInvokers to deactivate themselves...
529
531
while (this .activeInvokerCount > 0 ) {
530
532
if (logger .isDebugEnabled ()) {
531
533
logger .debug ("Still waiting for shutdown of " + this .activeInvokerCount +
532
534
" message listener invokers" );
533
535
}
534
536
this .lifecycleMonitor .wait ();
535
537
}
538
+ // Clear remaining scheduled invokers, possibly left over as paused tasks...
539
+ for (AsyncMessageListenerInvoker scheduledInvoker : this .scheduledInvokers ) {
540
+ scheduledInvoker .clearResources ();
541
+ }
542
+ this .scheduledInvokers .clear ();
536
543
}
537
544
}
538
545
catch (InterruptedException ex ) {
0 commit comments