Route

Table of Contents

Usage
Properties
Related topics

Contains all elements that make up an individual route in a routing context

Usage

The Route pattern represents the <route/> element within the <camelContext/> element in a routing context file. You can insert multiple Route patterns inside the <camelContext/> element to build a multiple route project.

All route-building patterns and components must be placed on the canvas within a Route node.

Properties

Table 53, “Route Properties” describes the properties you can specify for a route using the Properties editor.

Table 53. Route Properties

NameDescription

Auto Startup

Specifies whether to start the route automatically when Camel starts up. The default is true.

Delayer

Specifies a delay, in milliseconds, that slows down message processing. This is useful during debugging, making it easier to inspect the logs while tracking messages. The default is 0.

Description

Specifies a textual description for the route. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.

Error Handler Ref

Specifies a reference to a bean that defines and applies an error handler.

Group

Specifies the name of a group of which the route is a member. This property is informational only. It is not used by Apache Camel.

Handle Fault

Specifies whether to convert fault messages into exceptions. Intended for applications deployed into a JBI container, so the Camel error handler can react to faults. The default is false.

Id

[Required] Specifies a unique id for the route. This id appears in the generated XML in Source view, on the label of the route node on the canvas, and in log entries. The tooling automatically generates and assigns a default Id, but you can change it.

Message History

Specifies whether to enable/disable Message History. When enabled, Apache Camel captures how the exchange is routed as an org.apache.camel.MessageHistory entity that is stored on the exchange. This information can be retrieved through Java code or through the error handler exhausted exceptions logs. For details, see Apache Camel: Message History The default is true.

Route Policy Ref

Specifies a reference to a bean that defines and applies a policy that controls routes at runtime. The bean can implement any logic that you want Apache Camel to invoke at route startup or at route shutdown.

Shutdown Route

Specifies how to gracefully shut down the route. The options are:

  • Default — Shuts the route down as soon as possible, but waits a timeout period of 300 seconds for any inflight and pending messages to complete. After the timeout period, it forces the route and its services to shutdown immediately.
  • Defer — For use when an internal route depends on another. This option defers shutdown until all inflight exchanges have completed, and allows the route to remain active through the graceful shutdown timeout period.

Shutdown Running Task

Specifies how to shut down a running task, and determines how a route consumer behaves during the shutdown. The options are:

  • Complete Current Task Only — [Default] The route consumer shut down as soon as the current, in-progress task (message) has been completed.
  • Complete All Tasks — For use with batch consumers that operate on many messages in batch. The route consumer shuts down after all pending tasks (messages) have been completed.

Startup Order

Configures the ordering of the routes being started.

Stream Cache

Specifies whether to cache streams that otherwise could not be accessed multiple times. This is necessary for implementing redelivery during error handling, which requires reading the stream multiple times. The default is false.

Trace

Specifies whether to trace the path of an exchange through a particular route. The default is false.


Related topics