ActiveMQ durable subscription - 6.3

Talend ESB Service Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Installation and Upgrade
Talend ESB

To connect to an ActiveMQ topic in a durable way, an additional parameter called durableSubscriptionName has to be specified in the connection URI. However, there is a limitation that from the side of one client, only one subscriber can be connected simultaneously to a given topic using a given durable subscription name. For example:


The JMS specification prohibits two or more subscribers using the same durableSubscriptionName and durableSubscriptionClientId to be connected to the same topic simultaneously. When using one WSDL for creation, for example provider and consumer (or multiple consumers), which is a usual situation, this becomes a problem, because the same JMS connection URI is shared among multiple participants. This means that if durableSubscriptionName or durableSubscriptionClientId is specified in the URI in the WSDL, all the participants will use the same parameters and only one of the participants will be allowed to connect to the topic by a message broker.

To manage this situation, a special Talend ESB feature called DurableSubscriptionFeature has been created. The feature is part of the transport-jms library, so no other dependencies are needed. The feature allows to specify durableSubscriptionName and durableSubscriptionClientId parameters individually for a participant. Here is an example of how to configure it in Spring configuration:

<bean id="subscriberDurableSubscriptionFeature" class="org.talend.esb.transport.jms.DurableSubscriptionFeature">
    <property name="durableSubscriptionClientId" value="someClientId"/>
    <property name="durableSubscriptionName" value="someSubscriptionName"/>

<jaxws:endpoint xmlns:library=""
    serviceName="library:LibraryProvider" endpointName="library:LibraryTopicPort"
        <ref bean="subscriberDurableSubscriptionFeature"/>

Note that to make DurableSubscriptionFeature work, the durableSubscriptionName parameter should be specified in the URI. The value of the parameter will be replaced with the one provided by the feature.