Contact Us 1-800-596-4880

Idempotent Filter

This filter ensures that only unique messages are received by a service by checking the unique ID of the incoming message.

Idempotent Message Filter

Ensures that only unique messages are received by a service by checking the unique ID of the incoming message. Note that the ID used can be generated from the message using an expression defined in the 'idExpression' attribute. By default, the expression used is #[message:id], which means the underlying endpoint must support unique message IDs for this to work. Otherwise, a UniqueIdNotSupportedException is thrown.

Attributes of idempotent-message-filter

Attribute Description

name

Identifies the processor so that other elements can reference it. Required if the processor is defined at the global level.

Type: name (no spaces)
Required: No
Default: None

onUnaccepted

Events that are not accepted by the filter are sent to this (optional) named message processor.

Type: string
Required: No
Default: None

throwOnUnaccepted

Whether to throw an exception if a message is not accepted.

Type: boolean
Required: No
Default: None

idExpression

Defines one or more expressions to use when extracting the ID from the message. For example, it’s possible to combine headers as the ID of the message to provide idempotency:

#[headers:foo,bar]

Or, you could combine the message ID with a header:

#[message:id]-#[header:foo]

If this property is not set, the following is used by default:

#[message:id]

Type: string
Required: No
Default: None

valueExpression

Defines one or more expressions to use when extracting the value from the message.

Type: string
Required: No
Default: None

storePrefix

Defines the prefix of the object store names.

Type: name (no spaces)
Required: No
Default: None

Child Elements of idempotent-message-filter

Name Cardinality Description

abstract-object-store

0..1

A placeholder for an object store that can be used by routers to maintain state.

Idempotent Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Attributes of idempotent-redelivery-policy

Attribute Description

maxRedeliveryCount

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message.

Type: integer
Required: No
Default: 5

useSecureHash

Whether to use a secure hash algorithm to identify a redelivered message.

Type: boolean
Required: No
Default: true

messageDigestAlgorithm

The secure hashing algorithm to use. If not set, the default is SHA-256.

Type: string
Required: No
Default: None

idExpression

Defines one or more expressions to use to determine when a message has been redelivered. For example,it would be possible to combine to headers as the unique ID of the message:

#[headers:foo,bar]

Or, you could combine the message ID with a header:

#[message:id]-#[header:foo]

This property may only be set if useSecureHash is false.

Type: string
Required: No
Default: None

object-store-ref

The object store where the redelivery counter for each message is going to be stored.

Type: string
Required: No
Default: None

Child Elements of idempotent-redelivery-policy

Name Cardinality Description

dead-letter-queue

0..1

Message processor to call if a message exceeds its redelivery count without being processed successfully.

Idempotent Secure Hash Message Filter

Ensures that only unique messages are received by a service by calculating the hash of the message itself using a message digest algorithm. This provides a value with an infinitesimally small chance of a collision. This can be used to filter message duplicates. Keep in mind that the hash is calculated over the entire byte array representing the message, so any leading or trailing spaces or extraneous bytes (like padding) can produce different hash values for the same semantic message content. Care should be taken to ensure that messages do not contain extraneous bytes. This class is useful when the message does not support unique identifiers.

Idempotent Receiver Router

Ensures that only unique messages are received by a service by checking the unique ID of the incoming message. Note that the ID used can be generated from the message using an expression defined in the idExpression attribute. By default, this expression used is:

#[message:id]

This means that the underlying endpoint must support unique message IDs for this to work. Otherwise, a UniqueIdNotSupportedException is thrown.

Attributes of idempotent-receiver-router

Attribute Description

idExpression

Defines one or more expressions to use when extracting the ID from the message. For example, it would be possible to combine to headers as the ID of the message to provide idempotency:

#[headers:foo,bar]

Or, you could combine the message ID with a header:

#[message:id]-#[header:foo]

If this property is not set, this is used by default:

#[message:id]

Type: string
Required: No
Default: None

Child Elements of idempotent-receiver-router

Name Cardinality Description

abstract-object-store

0..1

A placeholder for an object store that can be used by routers to maintain state. Idempotent secure hash receiver router.

Idempotent Secure Hash Receiver Router

Ensures that only unique messages are received by a service by calculating the hash of the message itself using a message digest algorithm. This provides a value with an infinitesimally small chance of a collision. This can be used to filter message duplicates. Keep in mind that the hash is calculated over the entire byte array representing the message, so any leading or trailing spaces or extraneous bytes (like padding) can produce different hash values for the same semantic message content. Care should be taken to ensure that messages do not contain extraneous bytes. This class is useful when the message does not support unique identifiers.

Attributes of idempotent-secure-hash-receiver-router

Attribute Description

messageDigestAlgorithm

The secure hashing algorithm to use. If not set, the default is SHA-256.

Type: string
Required: No
Default: None

Child Elements of idempotent-secure-hash-receiver-router

Name Cardinality Description

abstract-object-store

0..1

A placeholder for an object store that can be used by routers to maintain state.