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 2012/11/03 10:42:08 UTC

svn commit: r1405313 - /camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java

Author: davsclaus
Date: Sat Nov  3 09:42:07 2012
New Revision: 1405313

URL: http://svn.apache.org/viewvc?rev=1405313&view=rev
Log:
Enricher EIP should store TO_ENDPOINT as property like the others do.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java?rev=1405313&r1=1405312&r2=1405313&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java Sat Nov  3 09:42:07 2012
@@ -140,12 +140,8 @@ public class Enricher extends ServiceSup
                     }
                 }
 
-                // set header with the uri of the endpoint enriched so we can use that for tracing etc
-                if (exchange.hasOut()) {
-                    exchange.getOut().setHeader(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
-                } else {
-                    exchange.getIn().setHeader(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
-                }
+                // set property with the uri of the endpoint enriched so we can use that for tracing etc
+                exchange.setProperty(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
 
                 callback.done(false);
             }
@@ -183,12 +179,8 @@ public class Enricher extends ServiceSup
             }
         }
 
-        // set header with the uri of the endpoint enriched so we can use that for tracing etc
-        if (exchange.hasOut()) {
-            exchange.getOut().setHeader(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
-        } else {
-            exchange.getIn().setHeader(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
-        }
+        // set property with the uri of the endpoint enriched so we can use that for tracing etc
+        exchange.setProperty(Exchange.TO_ENDPOINT, producer.getEndpoint().getEndpointUri());
 
         callback.done(true);
         return true;