3 Replies Latest reply on May 13, 2009 6:43 PM by davestanley

    Camel-JMS Durable Subscriber

    gmotts_gary.motts

      Hi,

       

      I?m attempting to implement a durable subscriber using camel-jms with Fuse ESB v3.4.  I?m also using Fuse Message Broker, so when I log into the server console I can easily view the message queues, topics and subscribers.

       

      The following camel route works, a message that is routed to the topic is received by the queue named example1.  However, when I view the admin console no subscriber is visible nor can I see the subscriber through the JMS console.  There are no errors reported in the servicemix log file for the

       

      from("activemq:topic:topic").filter((myPredicate)).to("activemq:queue:example1?clientId=client1&cacheLevelName=CACHE_CONSUMER&durableSubscriptionName=TopicReader1&subscriptionDurable=true");

       

      I?d like to seek advice on this implementation.  Is creating a durable subscriber possible using a filter?  As an alternative and better implementation I?d like to explore the use of Virtual topics and queues. 

       

       

      -Gary

        • 1. Re: Camel-JMS Durable Subscriber
          davestanley

          Hi Gary,

          It looks like you need something like this:

           

          from("activemq:topic:topic").filter((myPredicate)).to("activemq:queue:example1");
          

           

          And then set your durable subscriber up as follows

           

          from(activemq:queue:example1?clientId=client1&cacheLevelName=CACHE_CONSUMER&durableSubscriptionName=TopicReader1&subscriptionDurable=true").to("....");
          

           

          Regards

          /Dave

           

          Edited by: dstanley on May 13, 2009 3:41 PM

          • 2. Re: Camel-JMS Durable Subscriber
            gmotts_gary.motts

            Thanks Dave!

             

            It worked, with one change.  I received an error " durable subscription requires a topic" so I defined a topic to topic filter, which then enabled me to define a durable subscriber.  I looked through the camel manual and could not find a property that designates the topic name for a durable subscriber.:

             

            from("activemq:topic:topic").filter((myPredicate)).to("activemq:topic:exampletTopic1");

             

            from(activemq:topic:exampleTopic1?clientId=client1&cacheLevelName=CACHE_CONSUMER&durableSubscriptionName=TopicReader1&subscriptionDurable=true").to("activemq:queue:durableSubscriberQueue1");

             

            Many thanks,:8}

             

            Gary

            • 3. Re: Camel-JMS Durable Subscriber
              davestanley

              Great, thanks for the update and glad to hear you are up and running.

               

              /Dave