org.apache.camel.spi
Interface IdempotentRepository<E>

All Superinterfaces:
Service
All Known Implementing Classes:
FileIdempotentRepository, MemoryIdempotentRepository

public interface IdempotentRepository<E>
extends Service

Access to a repository of Message IDs to implement the Idempotent Consumer pattern.

The add and contains methods is operating according to the Set contract.

The repository supports eager (default) and non-eager mode.

Notice the remove callback, can be configured to be disabled.

Version:

Method Summary
 boolean add(E key)
          Adds the key to the repository.
 boolean confirm(E key)
          Confirms the key, after the exchange has been processed successfully.
 boolean contains(E key)
          Returns true if this repository contains the specified element.
 boolean remove(E key)
          Removes the key from the repository.
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Method Detail

add

boolean add(E key)
Adds the key to the repository.

Important: Read the class javadoc about eager vs non-eager mode.

Parameters:
key - the key of the message for duplicate test
Returns:
true if this repository did not already contain the specified element

contains

boolean contains(E key)
Returns true if this repository contains the specified element.

Important: Read the class javadoc about eager vs non-eager mode.

Parameters:
key - the key of the message
Returns:
true if this repository contains the specified element

remove

boolean remove(E key)
Removes the key from the repository.

Is usually invoked if the exchange failed.

Important: Read the class javadoc about eager vs non-eager mode.

Parameters:
key - the key of the message for duplicate test
Returns:
true if the key was removed

confirm

boolean confirm(E key)
Confirms the key, after the exchange has been processed successfully.

Important: Read the class javadoc about eager vs non-eager mode.

Parameters:
key - the key of the message for duplicate test
Returns:
true if the key was confirmed


Apache Camel