How to prevent duplicate with normal payload
I have a system which expose an Web Service. The Web Service define that if the 2 service calls have same checksum (I've used MD5 to calculate checksum of the HTTP Request body), so that's the duplicate method call and should not process.
What I want is some ways to reject the new incoming message if it already existed in my channel. I've read through the document and only found out that there are prevent duplicates mechanism for things like Feed or File. Please point me if I missed it somewhere.
Then I looked at the ChannelInterceptor and I think that I can implement the preSend to check the message, however, I worry that after the message passed my preSend, is it immediately store into the MessageStore (eg JDBC)? Say for I have 2 duplicate messages come in a short time, the 2nd message may got pass the preSend does to the 1st message not store into the mentioned MessageStore?