Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using Interceptors

You can register interceptors on a RouteBuilder so that they are inherited by all child routes. You can also use the DSL itself to write interceptors...

Code Block

// lets log all steps in all routes
interept().to("log:foo");

from("seda:foo").to("seda:bar");

You can also add a predicate to the intercept() method so that your interceptor will only be invoked if the predicate is true.

Code Block

// lets log messages from gold customers
interept(xpath("/customer[@type='gold']).to("log:customer");

from("seda:foo").to("seda:bar");

See Also

For more examples of the DSL in action see

...