This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 38c0ad7  improve Exchange javadoc regarding when getFromEndpoint 
returning null (#5577)
38c0ad7 is described below

commit 38c0ad70c90c1e95ffd863089074b64a8ba7a5dd
Author: Babak Vahdat <[email protected]>
AuthorDate: Mon May 17 14:30:18 2021 +0200

    improve Exchange javadoc regarding when getFromEndpoint returning null 
(#5577)
    
    * improve Exchange javadoc regarding when getFromEndpoint returning null
    
    * improve javadoc
---
 .../src/main/java/org/apache/camel/Exchange.java          | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/Exchange.java 
b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
index a8bcd31..a263a03 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Exchange.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Exchange.java
@@ -630,13 +630,24 @@ public interface Exchange {
 
     /**
      * Returns the endpoint which originated this message exchange if a 
consumer on an endpoint created the message
-     * exchange, otherwise this property will be <tt>null</tt>
+     * exchange, otherwise his property will be <tt>null</tt>.
+     * 
+     * Note: In case this message exchange has been cloned through another 
parent message exchange (which itself has
+     * been created through the consumer of it's own endpoint), then if 
desired one could still retrieve the consumer
+     * endpoint of such a parent message exchange as the following:
+     * 
+     * <pre>
+     * getContext().getRoute(getFromRouteId()).getEndpoint()
+     * </pre>
      */
     Endpoint getFromEndpoint();
 
     /**
      * Returns the route id which originated this message exchange if a route 
consumer on an endpoint created the
-     * message exchange, otherwise this property will be <tt>null</tt>
+     * message exchange, otherwise his property will be <tt>null</tt>.
+     * 
+     * Note: In case this message exchange has been cloned through another 
parent message exchange then this method
+     * would return the <tt>fromRouteId<tt> property of that exchange.
      */
     String getFromRouteId();
 

Reply via email to