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 13 describes the properties you can specify using the properties editor.

Table 13. Idempotent Consumer Properties

NameDescription
languageSpecifies the expression language used to process the expression.
Message Id Repository RefSpecifies a reference to the implementation of IdempotentRepository used to store the message IDs.
Completion EagerSpecifies whether to complete the idempotent consumer eager or when the exchange is done. The default is Disabled.
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.
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.
Id

Specifies a unique identifier for the endpoint.

The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id.

You can use the id to refer to endpoints in your Camel XML file.

Remove On FailureSpecifies whether to remove the ID of a failed exchange. The default is Disabled.
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.

Related topics

Expression and Predicates Languages
Configuring the route editor