[
https://issues.apache.org/jira/browse/CAMEL-9965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-9965.
--------------------------------
Resolution: Fixed
Assignee: Claus Ibsen
Fix Version/s: 2.19.0
Added information in javadoc for those getters
> Throw meaningful exception of a streamed body has been consumed already
> -----------------------------------------------------------------------
>
> Key: CAMEL-9965
> URL: https://issues.apache.org/jira/browse/CAMEL-9965
> Project: Camel
> Issue Type: Improvement
> Components: camel-cxf
> Affects Versions: 2.16.3
> Reporter: Jürgen Kindler
> Assignee: Claus Ibsen
> Fix For: 2.19.0
>
>
> As I see in CAMEL-9864 there is an incompatible change about the usage of
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Message.html#getBody%28java.lang.Class%29
> in case the underlying body is subject to streaming.
> I understand the reasons for that change, but usually Java getters are
> assumed to be not modifying the underlying object.
> So it would be nice to add a small hint in the API that indicates that
> getBody may not be callable multiple times (esp. in context of streams)
> In case a stream was already consumed throwing a meaningful exception with a
> hint about how to fix this (either *not* call the method altogether or
> switching on stream caching ...) would be great.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)