THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Predicate using
when
to only trigger the interceptor in certain conditions proceed
to continue routing from the point of interception when the interceptor is finished.proceed
is default and can be omitted.stop
when used withintercept
will stops routing the Exchange completely. Camel will by default not stop.stop
skip
when used withinterceptSendToEndpoint
will skip sending the Exchange to the original intended endpoint. Camel will by default not skip.
...
And to skip sending to the mock:foo
endpoint we use the stop*skip()
DSL in the route at the end to instruct Camel to skip sending . The name *stop() is used as the interceptSendToEndpoint
builds on top of intercept
and thus we inherit the DSL keywordsto the original intended endpoint.
Wiki Markup |
---|
{snippet:id=e3|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/InterceptEndpointTest.java} |
...
Wiki Markup |
---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/interceptendpointwhen.xml} |
And the 3rd with the stop
skip
, notice skip is set with the skipSendToOriginalEndpoint
attribute on the interceptSendToEndpoint tag:
Wiki Markup |
---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/interceptendpointskip.xml} |