Versions Compared

Key

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

...

  • Predicate using when to only trigger the interceptor in certain conditions
  • stop forces to stop continue routing the Exchange and mark it as completed successful. Camel will by default not stop.
  • skip when used with interceptSendToEndpoint will skip sending the Exchange to the original intended endpoint. Camel will by default not skip.
  • interceptFrom and interceptSendToEndpoint supports endpoint URI matching by: exact uri, wildcard, regular expression. See advanced section.
  • The intercepted endpoint uri is stored as message header Exchange#INTERCEPTED_ENDPOINT.
Tip
tilestop

stop can be used in general, it does not have to be used with an Intercept you can use it in regular routing as well.

You can also instruct Camel to stop continue routing your message if you set the Exchange.ROUTE_STOP property to "true" or Boolean.TRUE on the Exchange. You can for instance do this from regular Java code in a POJO or Processor.

...

  • match by exact URI name. This is the sample we have seen above.
  • match by wildcard
  • match by regular expression.

The real endpoint that was intercepted is stored as uri in the message IN header with the key Exchange.INTERCEPTED_ENDPOINT.
This allows you to get hold of this information, when you for instance match by wildcard. Then you know the real endpoint that was intercepted and can react accordingly.

Match by wildcard

Match by wildcard allows you to match a range of endpoint or all of a given type. For instance use uri="file:*" will match all File based endpoints.

...