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 2009/05/01 19:45:01 UTC

svn commit: r770770 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/test/java/org/apache/camel/processor/intercept/ components/camel-spring/src/main/java/org/apache/came...

Author: davsclaus
Date: Fri May  1 17:45:01 2009
New Revision: 770770

URL: http://svn.apache.org/viewvc?rev=770770&view=rev
Log:
CAMEL-1578: Added filter by endpoint URI for interceptFrom.

Added:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java   (contents, props changed)
      - copied, changed from r770746, camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptEndpoint.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromUriSimpleLogTest.java
      - copied, changed from r770754, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromSimpleLogTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java   (contents, props changed)
      - copied, changed from r770754, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml   (contents, props changed)
      - copied, changed from r770754, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromTest.xml
Removed:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptEndpoint.java
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=770770&r1=770769&r2=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Fri May  1 17:45:01 2009
@@ -401,8 +401,8 @@
     public <T extends Endpoint> T getEndpoint(String name, Class<T> endpointType) {
         Endpoint endpoint = getEndpoint(name);
 
-        if (endpoint instanceof InterceptEndpoint) {
-            endpoint = ((InterceptEndpoint) endpoint).getDelegate();
+        if (endpoint instanceof InterceptSendToEndpoint) {
+            endpoint = ((InterceptSendToEndpoint) endpoint).getDelegate();
         }
         if (endpointType.isInstance(endpoint)) {
             return endpointType.cast(endpoint);

Copied: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java (from r770746, camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptEndpoint.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java?p2=camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java&p1=camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptEndpoint.java&r1=770746&r2=770770&rev=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java Fri May  1 17:45:01 2009
@@ -35,9 +35,9 @@
  *
  * @version $Revision$
  */
-public class InterceptEndpoint implements Endpoint {
+public class InterceptSendToEndpoint implements Endpoint {
 
-    private static final transient Log LOG = LogFactory.getLog(InterceptEndpoint.class);
+    private static final transient Log LOG = LogFactory.getLog(InterceptSendToEndpoint.class);
 
     private final Endpoint delegate;
     private Producer producer;
@@ -50,7 +50,7 @@
      * @param destination  the original endpoint
      * @param skip <tt>true</tt> to skip sending after the detour to the original endpoint
      */
-    public InterceptEndpoint(final Endpoint destination, boolean skip) {
+    public InterceptSendToEndpoint(final Endpoint destination, boolean skip) {
         this.delegate = destination;
         this.skip = skip;
     }

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/InterceptSendToEndpoint.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java?rev=770770&r1=770769&r2=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptFromDefinition.java Fri May  1 17:45:01 2009
@@ -41,7 +41,6 @@
     // TODO: we need a new interceptDefinition to uses the InterceptStrategy so its applied for each route step
     // and a more intelligent Channel so we can stop or proceed on-the-fly
 
-    // TODO: Filter by from endpoint uri
     // TODO: Support lookup endpoint by ref (requires a bit more work)
     // TODO: Support wildcards for endpoints so you can match by scheme, eg jms:*
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java?rev=770770&r1=770769&r2=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java Fri May  1 17:45:01 2009
@@ -26,7 +26,7 @@
 import org.apache.camel.Endpoint;
 import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
-import org.apache.camel.impl.InterceptEndpoint;
+import org.apache.camel.impl.InterceptSendToEndpoint;
 import org.apache.camel.processor.InterceptEndpointProcessor;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.ObjectHelper;
@@ -57,7 +57,7 @@
 
     @Override
     public String toString() {
-        return "InterceptEndpoint[" + uri + " -> " + getOutputs() + "]";
+        return "InterceptSendToEndpoint[" + uri + " -> " + getOutputs() + "]";
     }
 
     @Override
@@ -79,19 +79,19 @@
         // we have to reuse the createProcessor method to build the detour route
         // afterwards we remove this interceptor from the route so the route will
         // not use regular intercptor. The interception by endpoint is triggered
-        // by the InterceptEndpoint that handles the intercept routing logic
+        // by the InterceptSendToEndpoint that handles the intercept routing logic
         Endpoint endpoint = lookupEndpoint(routeContext.getCamelContext());
 
         // create the detour
         Processor detour = routeContext.createProcessor(this);
 
         // set the detour on the endpoint proxy
-        InterceptEndpoint proxy = routeContext.getCamelContext().getTypeConverter().mandatoryConvertTo(InterceptEndpoint.class, endpoint);
+        InterceptSendToEndpoint proxy = routeContext.getCamelContext().getTypeConverter().mandatoryConvertTo(InterceptSendToEndpoint.class, endpoint);
         proxy.setDetour(detour);
 
         // remove the original intercepted route from the outputs as we do not intercept as the regular interceptor
         // instead we use the proxy endpoints producer do the triggering. That is we trigger when someone sends
-        // an exchange to the endpoint, see InterceptEndpoint for details.
+        // an exchange to the endpoint, see InterceptSendToEndpoint for details.
         RouteDefinition route = routeContext.getRoute();
         List<ProcessorDefinition> outputs = route.getOutputs();
         outputs.remove(this);
@@ -100,13 +100,13 @@
     }
 
     public void proxyEndpoint(CamelContext context) {
-        // proxy the endpoint by using the InterceptEndpoint that will proxy
+        // proxy the endpoint by using the InterceptSendToEndpoint that will proxy
         // the producer so it processes the detour first
         Endpoint endpoint = lookupEndpoint(context);
 
         // decorate endpoint with our proxy
         boolean skip = skipSendToOriginalEndpoint != null ? skipSendToOriginalEndpoint : false;
-        InterceptEndpoint proxy = new InterceptEndpoint(endpoint, skip);
+        InterceptSendToEndpoint proxy = new InterceptSendToEndpoint(endpoint, skip);
         try {
             // add will replace the old one
             context.addEndpoint(proxy.getEndpointUri(), proxy);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java?rev=770770&r1=770769&r2=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RoutesDefinition.java Fri May  1 17:45:01 2009
@@ -44,7 +44,7 @@
     @XmlTransient
     private List<InterceptSendToEndpointDefinition> interceptSendTos = new ArrayList<InterceptSendToEndpointDefinition>();
     @XmlTransient
-    private List<OnExceptionDefinition> exceptions = new ArrayList<OnExceptionDefinition>();
+    private List<OnExceptionDefinition> onExceptions = new ArrayList<OnExceptionDefinition>();
     @XmlTransient
     private CamelContext camelContext;
     @XmlTransient
@@ -86,12 +86,12 @@
         this.interceptSendTos = interceptSendTos;
     }
 
-    public List<OnExceptionDefinition> getExceptions() {
-        return exceptions;
+    public List<OnExceptionDefinition> getOnExceptions() {
+        return onExceptions;
     }
 
-    public void setExceptions(List<OnExceptionDefinition> exceptions) {
-        this.exceptions = exceptions;
+    public void setOnExceptions(List<OnExceptionDefinition> onExceptions) {
+        this.onExceptions = onExceptions;
     }
 
     public CamelContext getCamelContext() {
@@ -181,15 +181,31 @@
         // lets configure the route
         route.setCamelContext(getCamelContext());
 
-        List<InterceptFromDefinition> intercepts = getInterceptFroms();
-        for (InterceptFromDefinition intercept : intercepts) {
-            // need to create a proxy for this one and use the
-            // proceed of the proxy which will be local to this route
-            InterceptFromDefinition proxy = intercept.createProxy();
-            route.addOutput(proxy);
-            route.pushBlock(proxy.getProceed());
+        // configure intercept from
+        for (InterceptFromDefinition intercept : getInterceptFroms()) {
+
+            // should we only apply interceptor for a given endpoint uri
+            boolean match = true;
+            if (intercept.getUri() != null) {
+                match = false;
+                for (FromDefinition input : route.getInputs()) {
+                    if (input.getUri().equals(intercept.getUri())) {
+                        match = true;
+                        break;
+                    }
+                }
+            }
+
+            if (match) {
+                // need to create a proxy for this one and use the
+                // proceed of the proxy which will be local to this route
+                InterceptFromDefinition proxy = intercept.createProxy();
+                route.addOutput(proxy);
+                route.pushBlock(proxy.getProceed());
+            }
         }
 
+        // configure intercept send to endpoint
         List<InterceptSendToEndpointDefinition> sendTos = getInterceptSendTos();
         for (InterceptSendToEndpointDefinition sendTo : sendTos) {
             // init interceptor by letting it proxy the real endpoint
@@ -197,7 +213,9 @@
             route.addOutput(sendTo);
         }
 
-        route.getOutputs().addAll(getExceptions());
+        // add on exceptions
+        route.getOutputs().addAll(getOnExceptions());
+
         getRoutes().add(route);
         return route;
     }
@@ -248,7 +266,7 @@
      */
     public OnExceptionDefinition onException(Class exception) {
         OnExceptionDefinition answer = new OnExceptionDefinition(exception);
-        getExceptions().add(answer);
+        getOnExceptions().add(answer);
         return answer;
     }
 

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromUriSimpleLogTest.java (from r770754, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromSimpleLogTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromUriSimpleLogTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromUriSimpleLogTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromSimpleLogTest.java&r1=770754&r2=770770&rev=770770&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromSimpleLogTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/intercept/InterceptFromUriSimpleLogTest.java Fri May  1 17:45:01 2009
@@ -22,13 +22,16 @@
 /**
  * Testing http://camel.apache.org/dsl.html
  */
-public class InterceptFromSimpleLogTest extends ContextTestSupport {
+public class InterceptFromUriSimpleLogTest extends ContextTestSupport {
 
     public void testInterceptLog() throws Exception {
-        getMockEndpoint("mock:result").expectedMessageCount(1);
         getMockEndpoint("mock:first").expectedMessageCount(1);
+        getMockEndpoint("mock:bar").expectedMessageCount(1);
+
+        getMockEndpoint("mock:result").expectedMessageCount(2);
 
         template.sendBody("direct:start", "Hello World");
+        template.sendBody("seda:foo", "Bye World");
 
         assertMockEndpointsSatisfied();
     }
@@ -37,13 +40,15 @@
         return new RouteBuilder() {
             public void configure() throws Exception {
                 // START SNIPPET: e1
-                // intercept all incomming routes and log it
-                interceptFrom().to("log:received");
+                // only trigger when incoming from seda:bar endpoint
+                interceptFrom("seda:bar").to("mock:bar");
 
                 // and here we have a couple of routes
                 from("direct:start").to("mock:first").to("seda:bar");
-                
+
                 from("seda:bar").to("mock:result");
+
+                from("seda:foo").to("mock:result");
                 // END SNIPPET: e1
             }
         };

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=770770&r1=770769&r2=770770&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java (original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java Fri May  1 17:45:01 2009
@@ -45,6 +45,7 @@
 import org.apache.camel.model.RouteContainer;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.model.TransactedDefinition;
+import org.apache.camel.model.FromDefinition;
 import org.apache.camel.model.config.PropertiesDefinition;
 import org.apache.camel.model.dataformat.DataFormatsDefinition;
 import org.apache.camel.processor.interceptor.Debugger;
@@ -287,37 +288,56 @@
     }
 
     private void initInterceptors(RouteDefinition route) {
+        // configure intercept from
         for (InterceptFromDefinition intercept : interceptFroms) {
-            List<ProcessorDefinition<?>> outputs = new ArrayList<ProcessorDefinition<?>>();
-            List<ProcessorDefinition<?>> exceptionHandlers = new ArrayList<ProcessorDefinition<?>>();
-            for (ProcessorDefinition output : route.getOutputs()) {
-                if (output instanceof OnExceptionDefinition) {
-                    exceptionHandlers.add(output);
-                } else {
-                    outputs.add(output);
+
+            // should we only apply interceptor for a given endpoint uri
+            boolean match = true;
+            if (intercept.getUri() != null) {
+                match = false;
+                for (FromDefinition input : route.getInputs()) {
+                    if (input.getUri().equals(intercept.getUri())) {
+                        match = true;
+                        break;
+                    }
                 }
             }
 
-            // clearing the outputs
-            route.clearOutput();
+            if (match) {
 
-            // add exception handlers as top children
-            route.getOutputs().addAll(exceptionHandlers);
+                List<ProcessorDefinition<?>> outputs = new ArrayList<ProcessorDefinition<?>>();
+                List<ProcessorDefinition<?>> exceptionHandlers = new ArrayList<ProcessorDefinition<?>>();
 
-            // add the interceptor but we must do some pre configuration beforehand
-            intercept.afterPropertiesSet();
-            InterceptFromDefinition proxy = intercept.createProxy();
-            route.addOutput(proxy);
-            route.pushBlock(proxy.getProceed());
-
-            // if there is a proceed in the interceptor proxy then we should add
-            // the current outputs to out route so we will proceed and continue to route to them
-            ProceedDefinition proceed = ProcessorDefinitionHelper.findFirstTypeInOutputs(proxy.getOutputs(), ProceedDefinition.class);
-            if (proceed != null) {
-                proceed.getOutputs().addAll(outputs);
+                for (ProcessorDefinition output : route.getOutputs()) {
+                    if (output instanceof OnExceptionDefinition) {
+                        exceptionHandlers.add(output);
+                    } else {
+                        outputs.add(output);
+                    }
+                }
+
+                // clearing the outputs
+                route.clearOutput();
+
+                // add exception handlers as top children
+                route.getOutputs().addAll(exceptionHandlers);
+
+                // add the interceptor but we must do some pre configuration beforehand
+                intercept.afterPropertiesSet();
+                InterceptFromDefinition proxy = intercept.createProxy();
+                route.addOutput(proxy);
+                route.pushBlock(proxy.getProceed());
+
+                // if there is a proceed in the interceptor proxy then we should add
+                // the current outputs to out route so we will proceed and continue to route to them
+                ProceedDefinition proceed = ProcessorDefinitionHelper.findFirstTypeInOutputs(proxy.getOutputs(), ProceedDefinition.class);
+                if (proceed != null) {
+                    proceed.getOutputs().addAll(outputs);
+                }
             }
         }
 
+        // configure intercept send to endpoint
         for (InterceptSendToEndpointDefinition intercept : interceptSendToEndpoints) {
             // special intercept for intercepting sending to an endpoint
             // init interceptor by letting it proxy the real endpoint

Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java (from r770754, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromTest.java&r1=770754&r2=770770&rev=770770&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java Fri May  1 17:45:01 2009
@@ -18,27 +18,18 @@
 
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.component.mock.MockEndpoint;
-
+import org.apache.camel.processor.intercept.InterceptFromUriSimpleLogTest;
 import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
 
-public class SpringInterceptFromTest extends ContextTestSupport {
-
-    public void testSetInterceptor() throws Exception {
-        MockEndpoint inteceptorEndpoint = getMockEndpoint("mock:middle1");
-        MockEndpoint resultEndpoint = getMockEndpoint("mock:end");
-        resultEndpoint.expectedBodiesReceived("Hello World!");
-        inteceptorEndpoint.expectedBodiesReceived("Hello World!");
-
-        sendBody("direct:start", "Hello World!");
+public class SpringInterceptFromUriSimpleLogTest extends InterceptFromUriSimpleLogTest {
 
-        inteceptorEndpoint.assertIsSatisfied();
-        resultEndpoint.assertIsSatisfied();
+    @Override
+    public boolean isUseRouteBuilder() {
+        return false;
     }
 
     protected CamelContext createCamelContext() throws Exception {
-        return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringInterceptFromTest.xml");
+        return createSpringCamelContext(this, "org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml");
     }
 
-}
+}
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml (from r770754, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromTest.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromTest.xml&r1=770754&r2=770770&rev=770770&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromTest.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml Fri May  1 17:45:01 2009
@@ -24,18 +24,27 @@
 
     <!-- START SNIPPET: example -->
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
-        <!-- intercept incoming messages and route them to the mock:middle1 endpoint
-             before we proceed and continue routing from the point of interceptions, that
-             is mock:end will be the next target -->
-        <interceptFrom>
-            <to uri="mock:middle1"/>
+        <!-- intercept incoming message arriving on the seda:bar endpoint -->
+        <interceptFrom uri="seda:bar">
+            <to uri="mock:bar"/>
         </interceptFrom>
 
-        <!-- here we have a very simple route -->
         <route>
             <from uri="direct:start"/>
-            <to uri="mock:end"/>
+            <to uri="mock:first"/>
+            <to uri="seda:bar"/>
         </route>
+
+        <route>
+            <from uri="seda:bar"/>
+            <to uri="mock:result"/>
+        </route>
+
+        <route>
+            <from uri="seda:foo"/>
+            <to uri="mock:result"/>
+        </route>
+
     </camelContext>
     <!-- END SNIPPET: example -->
 </beans>

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringInterceptFromUriSimpleLogTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml