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

RabbitMQ specific message properties are forwarded as message headers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.15.2
    • 2.16.1, 2.17.0
    • camel-rabbitmq
    • None
    • 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

            acosentino Andrea Cosentino
            nfx Serge Smertin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: