You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Routes

Camel supports the definition of routing rules using a Java DSL (domain specific language) which avoids the need for cumbersome XML using a RouteBuilder.

For example a simple route can be created as follows.

Error formatting macro: snippet: java.lang.NullPointerException

As you can see from the above Camel uses URIs to wire endpoints together.

Filters

You can combine simple routes with filters which can be arbitrary Predicate implementations.

Error formatting macro: snippet: java.lang.NullPointerException

Choices

With a choice you provide a list of predicates and outcomes along with an optional default otherwise clause which is invoked if none of the conditions are met.

Error formatting macro: snippet: java.lang.NullPointerException

Using a custom processor

Here is an example of using a custom Processor

Error formatting macro: snippet: java.lang.NullPointerException

You can mix and match custom processors with filters and choices.

Error formatting macro: snippet: java.lang.NullPointerException

Interceptors

Here is an example of adding a few custom InterceptorProcessor objects to a processing pipeline:

Error formatting macro: snippet: java.lang.NullPointerException

When you start defining and interceptor stack with intercept(), you must follow up with the subsequent .target() so that the target of the interceptor stack is properly registered.

  • No labels