There are various types of connections which define how to route your messages within a camel Route.
Right-click a component on the design workspace to display a contextual menu that lists all available links for the selected component.
The sections below describe all available connection types.
A Row connection handles the messages to be routed. The Row connections can be try, catch, finally or route according to the component selected.
This type of connection is the most commonly used connection. It passes on messages from one endpoint to the other, or from one endpoint to a processor and from a processor to another endpoint.
This link connects specifically a cTry component to a receiving component to be able to handle error in part of your Route.
To isolate the part of your Route likely to generate an error, you can put it in a Try block via the cTry component and its try link. Once isolated, if the Route generates an error, the error will by sent to the error handler unless a Catch block is found right after the Try block. For more information, see the catch section below.
The catch link can only be used with a cTry component and if a try link has already been used in order to isolate a part of a Route likely to generate an error.
So, the catch link catches the errors generated by the Route put in a Try block and enable you to handle it, if necessary, and continue the Route, if possible.
The finally link can only be used with a cTry component and if a try link has already been used to isolate part of a Route likely to generate an error.
The finally link will enable you to execute final instructions regardless of any problem that may occur in the Try and/or Catch block, to close a connection to a database, for example.
Trigger connections define specific channels to route messages in according to specific conditions.
Messages will be filtered and routed to specific Routes according to defined conditions.
The when link connects specifically a cMessageRouter component to receiving components to filter and route messages in one or several output Routes according to specified conditions.
These conditions can be defined in the Connection settings of each when link you create in your Route. Messages not matching the condition set can be retrieved with an otherwise link. For more information, see the otherwise section below.
The otherwise link can only be used with a cMessageRouter component and if at least one when link has already been used to filter and route messages.
So, the otherwise link retrieves all messages that are not matching the conditions defined in the several when links.
It is recommended not to put any message handling after the when or the otherwise link. Always use a Mock/Direct endpoint to replace them and make a new Route to handle the messages.