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

getBody(Class<T> type) on originalMessage returns null

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.18.2
    • Fix Version/s: 2.18.3, 2.19.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      It seems that the purpose of getBody(Class<T> type) is to convert the message body to the requested type. When this is used on a getUnitOfWork().getOriginalInMessage() message though the conversion doesn't happen. Debugging indicates this is because the message's exchange variable is null.

      For example requesting a string type when using a File queue fails as a conversion from GenericFile to String is required.

      It seems like the exchange should be set/copied when the originalInMessage is created (in the DefaultUnitOfWork constructor) so this functionality can work.

      Reference to mailing list dicussion: http://mail-archives.apache.org/mod_mbox/camel-dev/201702.mbox/ajax/%3Ce8b612e0-60ab-1a51-b024-87b48e024c51%40me.uk.eu.org%3E

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              tristanh Tristan Hill
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: