IdempotentConsumer usage

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

IdempotentConsumer usage


I'm looking at the IdempotentConsumer to prevent duplicates.

I have a camel endpoint that sees a list of objects come in. The list can contain between 1 and N internal objects. I need to prevent the internal object been a duplicate for a time period of time (say 5 mins). I was looking for a way to create an Expression that would take the exchange, ensure that the message type is correct, cast it and iterate through the list of objects, getting and storing the hashcode of each object. This would hopefully allow me to check for duplicates and remove them.

I just cannot get around how this is to be done using Expressions. Would greatly appreciate any input on where to start.