8 Replies Latest reply on Aug 16, 2012 3:25 AM by Morten Minke

    Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?

    Rebecca Powell Newbie

      We are interested in implementing Publish/Subscribe solutions  in JBoss ESB, using JMS Topics.

      I'm certainly able to implement a service that Publishes to a JMS Topic, and a "Subscriber" that reads from that topic.

       

      However, the requirement is that the subscriptions be durable.

      I haven't found anything yet indicating that this is supported in JBoss ESB, and how.

       

      Is it supported?  (and if so, I could use some hints or a sample!)

      Or will we have to implement our own solution in JBossESB?

       

      Thanks,

      Rebecca

        • 1. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
          Jennifer Lentz Newbie

          Jira JBESB-1890 (Unable to configure jms-message-filter as durable  subscriber to a Topic) was submitted July 30, 2008 - https://jira.jboss.org/jira/browse/JBESB-1890.  It's marked as having Major priority.  Does anyone know when this might get worked on?  If this is not the approach favored by JBoss architects for durable subscriber support, should we enter a new Jira ticket for JBoss ESB durable subscriber support?

           

          Thanks,

          Jennifer

          • 2. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
            Mike Finn Newbie

            The key is, as Kevin suggested in the JIRA, to use JCA/JMS inflow instead of the 'standard' JMS gateway. Here is how:

             

                    <service category="" name="" description="">
                        <listeners>
                            <jca-gateway
                                name="JMS-JCA-Gateway"
                                adapter="jms-ra.rar"
                                endpointClass="org.jboss.soa.esb.listeners.jca.JmsEndpoint">
                                <activation-config>
                                    <property name="destinationType" value="javax.jms.Topic" />
                                    <property name="destination" value="topic/your_topic_name" />
                                    <property name="subscriptionDurability" value="Durable" />
                                    <property name="clientId" value="your_client_id" />
                                    <property name="subscriptionName" value="your_subscription_name" />
                                </activation-config>
                            </jca-gateway>
                            ...

             

             

             

            HTH,

            Mike

            • 3. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
              Kevin Conner Master

              Using jms-jca-provider instead of jca-gateway is an easier route as it tries to mirror the jms-provider configuration.

               

              You can see an example of this in the jms_transacted quickstart.

               

              http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/samples/quickstarts/jms_transacted/jboss-esb.xml

               

              destinationType and destination will be handled through the attributes, with the remaining properties specified within the activation-config element.

               

              Kev

              • 4. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
                Jennifer Lentz Newbie

                Thank you Mike and Kevin for your replies.  I ended up going with the jms-jca-provider approach:

                 

                <jms-jca-provider connection-factory="ClusteredXAConnectionFactory" name="JBossMessaging">
                  <jms-bus busid="newDataEsbChannel">
                    <jms-message-filter dest-name="topic/publish_new_data_esb" dest-type="TOPIC" transacted="true" />
                  </jms-bus>
                  <activation-config>
                     <property name="clientId" value="MyClientId" />
                     <property name="subscriptionDurability" value="Durable" />
                     <property name="subscriptionName" value="MySubscription" />
                   </activation-config>                      

                </jms-jca-provider>

                 

                This worked beautifully! Thanks again for your help.

                 

                Jennifer

                • 5. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
                  Cavaco Silva Newbie

                  Hello,

                   

                  I'm also using the jms-jca-provider to subscribe to a durable topic. All goes well except the messages published on the topic are delivered multiple times, every time I restart my service the message is consumed, acknowledgeMode is auto-acknowledge and the message should only be delivered once right? what may the problem?

                   

                  <jms-jca-provider connection-factory="ClusteredXAConnectionFactory" name="JBossMessaging XA Transactions" transacted="true">
                              <jms-bus busid="LoggingService_topicChannel">
                                  <jms-message-filter dest-name="topic/LoggingDurableTopic" dest-type="TOPIC" transacted="true" />
                              </jms-bus>
                              <activation-config>
                                  <property name="dLQMaxResent" value="0" />
                                  <property name="clientId" value="ESBDurableSubscriber" />
                                  <property name="acknowledgeMode" value="Auto-acknowledge" />
                                  <property name="subscriptionDurability" value="Durable" />
                                  <property name="subscriptionName" value="MySubscriptionName" />
                                  <property name="user" value="esbuser" />
                                  <property name="password" value="esbpassword" />

                              </activation-config>
                          </jms-jca-provider>

                   

                  Thanks,

                  Sergio

                  • 6. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
                    Morten Minke Newbie

                    I am trying to use a durable subscription to a topic which runs on Websphere ESB (all examples I see use the building Jboss messaging). With a normal standalone client application I can connect to the Websphere ESB without problems. I can also use the jms-provider in the JBoss ESB configuration, but then I do not have a durable subscription!

                     

                    However, I do not know how to configure the jms-jca-provider, nothing seems to work. (I triend to configure the jndi-URL but in the jms-jca-provider that setting is never used whatever rubish I enter there!

                    My configuration which works looks like:

                     

                    <jms-provider connection-factory="${connectionfactory}"

                              jndi-context-factory="${initialcontextfactory}"

                              name="jmsGwProvider" jndi-URL="${providerurl}">

                              <jms-bus busid="jmsGwChannel">

                                        <jms-message-filter dest-name="${topic}"

                                        dest-type="TOPIC"

                                        transacted="true" />

                              </jms-bus>

                    </jms-provider>

                     

                    The one which does NOT work:

                     

                    <jms-jca-provider connection-factory="${connectionfactory}"

                              jndi-context-factory="${initialcontextfactory}"

                              name="jmsGwProvider" jndi-URL="${providerurl}">

                              <jms-bus busid="jmsGwChannel">

                                        <jms-message-filter dest-name="${topic}"

                                        dest-type="TOPIC"

                                        transacted="true" />

                              </jms-bus>

                     

                              <activation-config>

                             <property name="useDLQ" value="false" />

                                        <property name="subscriptionDurability" value="Durable" />

                                        <property name="subscriptionName" value="test"/>

                                        <property name="clientId" value="test" />

                              </activation-config>

                    </jms-jca-provider>

                     

                    Does anybody have an idea how I can setup the jca provider with the same information as the standard jms-provider?

                    • 7. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
                      Tom Cunningham Master

                      Can you give us more information - what connectionfactory is being used, what your settings are there, and what the error is?

                      • 8. Re: Is Publish/Subscribe using JMS Topics with Durable subscriptions supported?
                        Morten Minke Newbie

                        This is the error we get when using the jca provider, where the properties are substituted with the following values:

                         

                        connectionfactory:            jms/ClaimCheck/TCF

                        initialcontextfactory:         com.ibm.websphere.naming.WsnInitialContextFactory

                        providerurl:                     corbaloc:iiop:<<hostname>>:9809

                        topic:                              jms/Test/NotificationTopic

                         

                        We use the IBM sibc libraries (sibc.jms.jar, sibc.jndi.jar, sibc.orb.jar).

                         

                        2012-08-14 17:39:08,118 ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2)-7) Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@549306eb(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@224ce134 destination=jms/Test/NotificationTopic destinationType=javax.jms.Topic selector=(TestType = 'JMS') AND (TestFileName = 'XXXX') tx=true durable=true clientID=XXXX subscription=XXXX reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=false)

                        javax.naming.NameNotFoundException: jms not bound

                                at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

                                at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

                                at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

                                at org.jnp.server.NamingServer.lookup(NamingServer.java:396)

                                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)

                                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                                at javax.naming.InitialContext.lookup(InitialContext.java:409)

                                at org.jboss.util.naming.Util.lookup(Util.java:222)

                                at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)

                                at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)

                                at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:292)

                                at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:733)

                                at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

                                at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                                at java.lang.Thread.run(Thread.java:679)