You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/03/03 12:40:52 UTC

camel git commit: CAMEL-9965: Add javadoc about streaming problem

Repository: camel
Updated Branches:
  refs/heads/master 78e7a06b9 -> 76ddb8538


CAMEL-9965: Add javadoc about streaming problem


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/76ddb853
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/76ddb853
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/76ddb853

Branch: refs/heads/master
Commit: 76ddb85381489114b1362ec037089dd964787706
Parents: 78e7a06
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Mar 3 13:40:44 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Mar 3 13:40:44 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/Message.java    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/76ddb853/camel-core/src/main/java/org/apache/camel/Message.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/Message.java b/camel-core/src/main/java/org/apache/camel/Message.java
index a0e9c4d..ac4a7af 100644
--- a/camel-core/src/main/java/org/apache/camel/Message.java
+++ b/camel-core/src/main/java/org/apache/camel/Message.java
@@ -192,7 +192,11 @@ public interface Message {
     /**
      * Returns the body of the message as a POJO
      * <p/>
-     * The body can be <tt>null</tt> if no body is set
+     * The body can be <tt>null</tt> if no body is set.
+     * <p/>
+     * Notice if the message body is stream based then calling this method multiple times may lead to the stream not being able to be re-read again.
+     * You can enable stream caching and call the {@link StreamCache#reset()} method to reset the stream to be able to re-read again (if possible).
+     * See more details about <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
      *
      * @return the body, can be <tt>null</tt>
      */
@@ -200,6 +204,9 @@ public interface Message {
 
     /**
      * Returns the body of the message as a POJO
+     * <p/>
+     * Notice if the message body is stream based then calling this method multiple times may lead to the stream not being able to be re-read again.
+     * See more details about <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
      *
      * @return the body, is never <tt>null</tt>
      * @throws InvalidPayloadException Is thrown if the body being <tt>null</tt> or wrong class type
@@ -208,6 +215,10 @@ public interface Message {
 
     /**
      * Returns the body as the specified type
+     * <p/>
+     * Notice if the message body is stream based then calling this method multiple times may lead to the stream not being able to be re-read again.
+     * You can enable stream caching and call the {@link StreamCache#reset()} method to reset the stream to be able to re-read again (if possible).
+     * See more details about <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
      *
      * @param type the type that the body
      * @return the body of the message as the specified type, or <tt>null</tt> if no body exists
@@ -217,6 +228,10 @@ public interface Message {
 
     /**
      * Returns the mandatory body as the specified type
+     * <p/>
+     * Notice if the message body is stream based then calling this method multiple times may lead to the stream not being able to be re-read again.
+     * You can enable stream caching and call the {@link StreamCache#reset()} method to reset the stream to be able to re-read again (if possible).
+     * See more details about <a href="http://camel.apache.org/stream-caching.html">stream caching</a>.
      *
      * @param type the type that the body
      * @return the body of the message as the specified type, is never <tt>null</tt>.