Idempotent Consumer

Table of Contents

Usage
Related topics

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 39, “Idempotent Consumer Properties” describes the properties you can specify using the properties editor.

Table 39. Idempotent Consumer Properties

NameDescription

language

Specifies the expression language used to process the expression.

Message Id Repository Ref

Specifies a reference to the implementation of IdempotentRepository used to store the message IDs.

Completion Eager

Specifies whether to complete the idempotent consumer eager or when the exchange is done. The default is Disabled.

Description

Specifies 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.

Eager

Specifies 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 Failure

Specifies whether to remove the ID of a failed exchange. The default is Disabled.

Skip Duplicate

Specifies 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