2. Mule ESB – An ESB for the Modern Enterprise
Idempotent filter ensures that only unique messages are received
by a service by checking the unique ID of the incoming message.
Idempotent Filter is used to avoid any duplicate message in our
Mule flow
This filter also ensures removal of duplicate messages i.e., it will not
allow duplicate messages to pass through.
Note:
✓ ID 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.
Idempotent Filter
1
3. Mule ESB – An ESB for the Modern Enterprise
Through idempotent filter, we can achieve uniqueness of messages via
in-memory-store
simple-text-file-store
custom-object-store
managed-store
Ways to achieve uniqueness
2
4. Mule ESB – An ESB for the Modern Enterprise
Attributes of idempotent-message-filter
3
Attribute Type Required Default Description
1 name name
(no spaces)
No None Identifies the processor so that other elements can
reference it. Required if the processor is defined at
the global level.
2 onUnaccepted string No None Events that are not accepted by the filter are sent to
this (optional) named message processor.
3 throwOnUnaccepted boolean No None Whether to throw an exception if a message is not
accepted.
4 idExpression string No None Defines one or more expressions to use when
extracting the ID from the message.
5 valueExpression string No None Defines one or more expressions to use when
extracting the value from the message.
6 storePrefix name
(no spaces)
No None Defines the prefix of the object store names.
5. Mule ESB – An ESB for the Modern Enterprise
Child Elements of idempotent-message-filter
4
Name Cardinality Description
abstract-object-store 0..1
A placeholder for an object store that can be used by
routers to maintain state.
6. Mule ESB – An ESB for the Modern Enterprise
Attributes of idempotent-redelivery-policy
1
Attribute Type Required Default Description
1 maxRedeliveryCount integer No 5 The maximum number of times a message can be
redelivered and processed unsuccessfully before triggering
process-failed-message.
2 useSecureHash boolean No true Whether to use a secure hash algorithm to identify a
redelivered message.
3 messageDigestAlgorithm string No None The secure hashing algorithm to use. If not set, the default is
SHA-256.
4 idExpression string No None Defines one or more expressions to use to determine when
a message has been redelivered.
5 object-store-ref string No None The object store where the redelivery counter for each
message is going to be stored.
7. Mule ESB – An ESB for the Modern Enterprise
Child Elements of idempotent-redelivery-policy
1
Name Cardinality Description
dead-letter-queue 0..1
Message processor to call if a message exceeds its
redelivery count without being processed successfully.
8. Mule ESB – An ESB for the Modern Enterprise
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.
This class is useful when the message does not support unique identifiers.
Note:
✓ 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.
Idempotent Secure Hash Message Filter
5
9. Mule ESB – An ESB for the Modern Enterprise
Ensures that only unique messages are received by a service by checking the
unique ID of the incoming message.
Note:
✓ 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.
Idempotent Receiver Router
6
10. Mule ESB – An ESB for the Modern Enterprise
Attributes of idempotent-receiver-router
7
Attribute Type Required Default Description
1 idExpression string No None Identifies the processor so that other elements can
reference it. Required if the processor is defined at the
global level.
11. Mule ESB – An ESB for the Modern Enterprise
Child Elements of idempotent-receiver-router
8
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.
12. Mule ESB – An ESB for the Modern Enterprise
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.
This class is useful when the message does not support unique identifiers.
Note:
✓ 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.
Idempotent Secure Hash Message Filter
9
13. Mule ESB – An ESB for the Modern Enterprise
Attributes of idempotent-secure-hash-receiver-router
10
Attribute Type Required Default Description
1 messageDigestAlgorithm string No None The secure hashing algorithm to use.
If not set, the default is SHA-256.
14. Mule ESB – An ESB for the Modern Enterprise
Child Elements of idempotent-secure-hash-receiver-router
11
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.