Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9101

RabbitMQ specific message properties are forwarded as message headers

    Details

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

      Description

      org.apache.camel.component.rabbitmq.RabbitMQProducer#buildProperties does not remove message headers from exchange after property is set, leading to message header pollution.

      so constructs like

      final Object contentType = exchange.getIn().getHeader(RabbitMQConstants.CONTENT_TYPE);
              if (contentType != null) {
                  properties.contentType(contentType.toString());
              }
      

      must be rewritten as

      final Object contentType = exchange.getIn().removeHeader(RabbitMQConstants.CONTENT_TYPE);
              if (contentType != null) {
                  properties.contentType(contentType.toString());
              }
      

      I don't think that these are used in business logic as this is solely transport specific.

        Attachments

          Activity

            People

            • Assignee:
              ancosen Andrea Cosentino
              Reporter:
              nfx Serge Smertin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: