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

camel-rabbitmq - x-death header gets lost because of incorrect header value validation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.23.0
    • Fix Version/s: 3.0.0.RC3, 3.0.0
    • Component/s: camel-rabbitmq
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      In `RabbitMQMessageConverter.java`, some kind of header value validation is done:

          private Object getValidRabbitMQHeaderValue(Object headerValue) {
              if (headerValue instanceof String) {
                  return headerValue;
              } else if (headerValue instanceof Number) {
                  return headerValue;
              } else if (headerValue instanceof Boolean) {
                  return headerValue;
              } else if (headerValue instanceof Date) {
                  return headerValue;
              } else if (headerValue instanceof byte[]) {
                  return headerValue;
              } else if (headerValue instanceof LongString) {
                  return headerValue;
              }
      
              return null;
          }
      

      While this is correct for the listed typed, this is incomplete. An example of this is the `x-death` header, as explained on https://www.rabbitmq.com/dlx.html#effects. This header is basically a `List<Map<String,Object>>`.

      If a message with such header is consumed and then propagated to another queue, the header will be lost. An example use case is consuming a dead-letter queue and propagating the messages to another queue, possible after some delay, until the `count` field in the `x-death` header reached a certain threshold.

      I am happy to provide a self-contained example if this would be helpful.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              pbillen Peter Billen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: