Name

Idempotent Consumer — Filters out duplicate messages

Usage

The Idempotent Consumer pattern uses an expression to generate message IDs. The IDs are used to filter duplicate messages. When a duplicate is detected it is consumed.

The Idempotent Consumer pattern can be placed anywhere along the body of a route.

Properties

Table 14 describes the properties you can specify using the properties editor.

Table 14. Idempotent Consumer Properties

NameDescription
ExpressionSpecifies the expression used to generate message IDs.
languageSpecifies the expression language used to process the expression.
Remove On FailureSpecifies whether to remove the ID of a failed exchange. The default is Disabled.
Message Id Repository RefSpecifies a reference to the implementation of IdempotentRepository used to store the message IDs.
Inherit Error HandlerSpecifies whether the node should use the error handler configured for the route. The default is Disabled.
EagerSpecifies whether messages are eagerly added to the repository before the exchange finishes processing. If so, the route can identify duplicates while exchanges are still being processed. The default is Enabled.
Skip DuplicateSpecifies whether to skip duplicate messages. The default is Enabled. When disabled, a duplicate message continues through the node, but the exchange is marked a duplicate.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
DescriptionSpecifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.

Related topics

Expression and Predicates Languages
Configuring the route editor