3 Replies Latest reply on Dec 14, 2010 2:39 AM by davsclaus

    Camel isn't transporting JMS Headers

    nbaliga

      Hello,

      I am able to successfully use Camel (both in Spring XML and Java DSL) to send JMS messages from one endpoint to multiple/selected JMS endpoints.

       

      I have configured a <jms:consumer> and multiple <jms:provider>s and deployed a Camel SU for the mediation.

       

      For e.g. my route builder dsl looks something like:

       

      from("jbi:endpoint:http://com.poc.fuse.eip.recipientlist/router/camel")

              .multicast().to(

              "jbi:endpoint:http://com.poc.fuse.eip.recipientlist/ProviderService/Bqueue",

              "jbi:endpoint:http://com.poc.fuse.eip.recipientlist/ProviderService/Cqueue"

                        );

       

      However, I'm seeing that the JMS Headers from the consumer endpoint are not being preserved and made available in the provider endpoints.

       

      My understanding was that Camel would copy the headers transparently. Or is that true only when Camel is deployed standalone and is not dealing with JBI endpoints?

       

      Any help is appreciated.

        • 1. Re: Camel isn't transporting JMS Headers
          davsclaus

          The JMS spec only allow certain types as headers. So Camel will drop invalid headers. See the JMS spec and/or the JMS javadoc.

           

          Also this page documents about this

          http://camel.apache.org/jms

          • 2. Re: Camel isn't transporting JMS Headers
            nbaliga

            Yes, I'd read some forum posts where people had that issue.

             

            But I guess I must be doing something fundamentally wrong, because the JMS Headers that I'm trying to preserve through Fuse4 ESB, are the standard headers such as Priority, Reply To, Correlation Id etc.

             

            I send the messages to my JMS consumer endpoint via Active MQ's admin web interface. This eliminates Spring issues, if any.

             

            So, the form that is presented when you click "Send To"? That's what I'm filling out for populating my headers.

             

            Those should be transported transparently by Camel if I'm not mistaken.

            • 3. Re: Camel isn't transporting JMS Headers
              davsclaus

              Well that's Spring JMX (camel-jms uses Spring JMS) wacky API where you need to enable preserveMessageQos=true to tell it to preserve the QoS headers.

               

              Read about the option at the Camel JMS documentation