2. Agenda
• About
• Ways to achieve uniqueness
• Sample use case
• Demonstration
• Testing
• Conclusion
3. About
This filter ensures that only unique messages are received
by a service by checking the unique ID of the incoming
message.
This filter also ensures removal of duplicate messages i.e it
will not allow duplicate messages to pass through.
4. Ways to achieve uniqueness
Through idempotent filter, there are following ways to achieve uniqueness of
messages:
core: in-memory-store
core: simple-text-file-store
core: custom-object-store
core: managed-store
We’ll see how message uniqueness can be achieved through simple-text-file-
store with a sample use case in this presentation.
5. Sample use case
Let’s consider there is a link with unique uri parameter i.e. basically it contains
unique key to validate user request. With the help of message idempotent
filter each request will be validated, here we’ll see for static user
request(similarly dynamic can be achieved).
Sample URI for uniqueness: http://localhost:8081/idempotent/case1
Here case1 is considered as unique parameter/endpoint for a particular
request.
6. Demonstration
Let’s design a flow as shown below and make sure that Idempotent Message
filter has simple-text-file-store as object store location.
[Please refer next slide for configuration of individual components shown in the design]
8. Testing
Now let’s starting testing our application.
Initial request Second request
So, by using Idempotent Message filter, it restricts duplicate
messages/request.
9. Continue…
Also let’s see the object store location specified inside Idempotent Message
filter settings. It contains messages with unique ID:
10. Conclusion
So by this way we have seen that Idempotent Message filter is one of the
fantastic component provided in mule to support message/request
uniqueness.
There is just a few soft code done by the integration engineer to achieve the
most wanted security feature and that just ion the fly.