Tristan Hill created CAMEL-10851:
------------------------------------

             Summary: getBody(Class<T> type) on originalMessage returns null
                 Key: CAMEL-10851
                 URL: https://issues.apache.org/jira/browse/CAMEL-10851
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.18.2
            Reporter: Tristan Hill
            Priority: Minor


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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to