Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-5903

Message headers are lost when using the Broker Component for Camel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.11.1
    • 5.11.2, 5.12.0
    • Camel
    • None

    Description

      When using the broker camel component as defined here: http://activemq.apache.org/broker-camel-component.html

      There appears to be an undocumented limitation of the broker component's current implementation. I need to know whether said limitation is by design or an oversight. If it's an oversight then I can submit a patch for it.

      This example route does not work as expected - the JMSXGroupID header is lost when received by the broker component.

      <route>
      <from uri="broker:queue:test"/>
      <setHeader headerName="JMSXGroupID">
      <constant>123</constant>
      </setHeader>
      <to uri="broker:queue:test"/>
      </route>

      After single stepping with a debugger the component executes this code: https://github.com/apache/activemq/blob/master/activemq-camel/src/main/java/org/apache/activemq/camel/component/broker/BrokerProducer.java#L102

      As you can see from the method's implementation it only copies over a fixed set of six well-known headers. All other headers on the inbound message are discarded. Why not copy over every header? Consequently the JMSXGroupID header is not copied, despite being present on the inbound message.

      This would appear to be a bug in my opinion as I do not believe we should be loosing any headers on a message in this case.

      Attachments

        1. amq-5903.patch
          13 kB
          Heath Kesler

        Activity

          People

            Unassigned Unassigned
            charly Heath Kesler
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: