Jürgen Kindler created CAMEL-9965:
-------------------------------------
Summary: 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
Fix For: 2.16.4
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.4#6332)