You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2017/02/17 11:19:41 UTC

[jira] [Updated] (CAMEL-10851) getBody(Class type) on originalMessage returns null

     [ https://issues.apache.org/jira/browse/CAMEL-10851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-10851:
--------------------------------
    Issue Type: Improvement  (was: Bug)

> getBody(Class<T> type) on originalMessage returns null
> ------------------------------------------------------
>
>                 Key: CAMEL-10851
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10851
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.18.2
>            Reporter: Tristan Hill
>            Priority: Minor
>             Fix For: 2.19.0
>
>
> 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)