Idempotent Filter in Mule 4 | Filter in Mule 4

Idempotent filter in Mule 4

It will not allow payload to pass if same payload is allowed to pass more than once.



Idempotent filter configuration:

Method: POST

Input & output:
On hitting first time from postman:

On hitting second time with same payload:

XML project code:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="" xmlns=""
     xmlns:xsi="" xsi:schemaLocation="">
     <http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="6410b392-3fcc-4f5c-b1d0-e5be6f7811da" >
          <http:listener-connection host="" port="8085" />
     <flow name="test_idempotent" doc:id="6b29cfee-8203-410b-87cb-f44c693ec585" >
          <http:listener doc:name="Listener" doc:id="660ae438-50ed-4932-9a06-792624a29d87" config-ref="HTTP_Listener_config" path="/idem"/>
          <idempotent-message-validator doc:name="Idempotent Message Validator" doc:id="0197e194-1cb1-4b5d-9239-63c44ba726a0" idExpression="#[payload]"/>