From 4058f693e56d149c33f85b69a60d924e3275ff60 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 29 Nov 2012 23:08:46 +0100 Subject: [PATCH] DefaultMessageListenerContainer allows for concurrent subscription consumers on WebLogic/ActiveMQ Issue: SPR-10037 --- .../DefaultMessageListenerContainer.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java b/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java index a2d8dfabfdb..2b21cd94274 100644 --- a/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java +++ b/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java @@ -297,9 +297,10 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe * to scale the consumption of messages coming in from a queue. However, * note that any ordering guarantees are lost once multiple consumers are * registered. In general, stick with 1 consumer for low-volume queues. - *

Do not raise the number of concurrent consumers for a topic. - * This would lead to concurrent consumption of the same message, - * which is hardly ever desirable. + *

Do not raise the number of concurrent consumers for a topic, + * unless vendor-specific setup measures clearly allow for it. + * With regular setup, this would lead to concurrent consumption + * of the same message, which is hardly ever desirable. *

This setting can be modified at runtime, for example through JMX. * @see #setMaxConcurrentConsumers */ @@ -336,9 +337,10 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe * to scale the consumption of messages coming in from a queue. However, * note that any ordering guarantees are lost once multiple consumers are * registered. In general, stick with 1 consumer for low-volume queues. - *

Do not raise the number of concurrent consumers for a topic. - * This would lead to concurrent consumption of the same message, - * which is hardly ever desirable. + *

Do not raise the number of concurrent consumers for a topic, + * unless vendor-specific setup measures clearly allow for it. + * With regular setup, this would lead to concurrent consumption + * of the same message, which is hardly ever desirable. *

This setting can be modified at runtime, for example through JMX. * @see #setConcurrentConsumers */ @@ -470,16 +472,6 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe } } - @Override - protected void validateConfiguration() { - super.validateConfiguration(); - synchronized (this.lifecycleMonitor) { - if (isSubscriptionDurable() && this.concurrentConsumers != 1) { - throw new IllegalArgumentException("Only 1 concurrent consumer supported for durable subscription"); - } - } - } - //------------------------------------------------------------------------- // Implementation of AbstractMessageListenerContainer's template methods