We have an ActiveMQ / Camel configuration that has previously been using exclusively message queues, with concurrent consumers.
However, we're now introducing message topics, and finding that - because of the concurrent consumers - messages received in the topic are consumed mulltiple times.
What's the correct configuration for this scenario?
ie., we want multiple concurrent consumers for messages received on a queue, but only a single consumer defined for messages received on a topic.
Here's the current configuration:
<amq:connectionFactory id="amqConnectionFactory"
useAsyncSend="true" brokerURL="${${ptl.Servername}.jms.cluster.uri}"
userName="${jms.username}" password="${jms.password}" sendTimeout="1000"
optimizeAcknowledge="true" disableTimeStampsByDefault="true">
</amq:connectionFactory>
<bean id="cachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="amqConnectionFactory"></property>
<property name="cacheConsumers" value="true"></property>
<property name="cacheProducers" value="true"></property>
<property name="reconnectOnException" value="true"></property>
<property name="sessionCacheSize" value="${jms.sessioncachesize}"></property>
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="cachingConnectionFactory" />
<property name="transacted" value="false" />
<property name="concurrentConsumers" value="${jms.concurrentConsumer}" />
<property name="maxConcurrentConsumers" value="${jms.max.concurrentConsumer}" />
<property name="preserveMessageQos" value="true" />
<property name="timeToLive" value="${jms.timeToLive}" />
</bean>
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="jmsConfig" />
</bean>