Camel
  1. Camel
  2. CAMEL-6821

RabbitMQ Component unable to transfer custom headers

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.12.1
    • Fix Version/s: 2.12.2, 2.13.0
    • Component/s: camel-rabbitmq
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      There is no capability to pass in some custom headers through rabbitmq camel component. it seems only well-known headers of AMQP.BasicProperties are supported.

      1. 0001-CAMEL-6821-Add-support-for-custom-RabbitMQ-headers.patch
        17 kB
        David Keen
      2. RabbitMQProducer.patch
        1.0 kB
        Mayank Mishra
      3. RabbitMQProducerTest.patch
        1 kB
        Mayank Mishra

        Activity

        Hide
        Mayank Mishra added a comment -

        Adding Source code change and Unit test case for custom headers support

        Show
        Mayank Mishra added a comment - Adding Source code change and Unit test case for custom headers support
        Hide
        Mayank Mishra added a comment -

        FYI...It's also copying AMQP well known properties in the headers.

        Show
        Mayank Mishra added a comment - FYI...It's also copying AMQP well known properties in the headers.
        Hide
        David Keen added a comment -

        I guess we also need to do something on the consumer side to pull out any custom headers into the camel message. I've attached a patch for RabbitMQConsumer and RabbitMQEndpoint which should do this but it seems header values may need to be filtered or serialized somehow as com.rabbitmq.client.impl.Frame#fieldValueSize throws an IllegalArgumentException if it receives an object value that is not one of its expected types.

        Show
        David Keen added a comment - I guess we also need to do something on the consumer side to pull out any custom headers into the camel message. I've attached a patch for RabbitMQConsumer and RabbitMQEndpoint which should do this but it seems header values may need to be filtered or serialized somehow as com.rabbitmq.client.impl.Frame#fieldValueSize throws an IllegalArgumentException if it receives an object value that is not one of its expected types.
        Hide
        David Keen added a comment -

        I have added some filtering of headers in the producer so incompatible headers are not set. I have created a fork on GitHub here https://github.com/davidkeen/camel/tree/rabbitmq-headers. I will update my patchfile to include these changes.

        Show
        David Keen added a comment - I have added some filtering of headers in the producer so incompatible headers are not set. I have created a fork on GitHub here https://github.com/davidkeen/camel/tree/rabbitmq-headers . I will update my patchfile to include these changes.
        Hide
        David Keen added a comment -

        Added unit tests.

        Show
        David Keen added a comment - Added unit tests.
        Hide
        David Keen added a comment -

        Combine git patches into single file.

        Show
        David Keen added a comment - Combine git patches into single file.
        Hide
        Claus Ibsen added a comment -

        Thanks for the patch.

        Show
        Claus Ibsen added a comment - Thanks for the patch.
        Hide
        ASF GitHub Bot added a comment -

        Github user jfarrell closed the pull request at:

        https://github.com/apache/camel/pull/50

        Show
        ASF GitHub Bot added a comment - Github user jfarrell closed the pull request at: https://github.com/apache/camel/pull/50

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Mayank Mishra
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development