sbisson: (Default)
sbisson ([personal profile] sbisson) wrote2002-07-05 09:01 am

Idempotence: avoiding errors in web service interactions

I'm currently sitting in the main hall at TechEd, filling in the gap between the first and second parts of Don Box's 3 part extravaganza presentation. He's talking about the problems that can arise when using web services to handle distributed computing - and thinking about the solutions...

One key point is the concept of idempotent messages: messages that can be sent many times with the same effect - so there is no difference in the result between message 1 and message n.

To explain a bit further, this can be very important if you're in the middle of a transaction and a send-action-response sequence fails to send the response, so you resend, only to trigger another instance of the action... Leaving you to deal with the consequences of send-action-send-action-send-action-response - where the response only reports the last send-action pair...

Now, the idea's clear... but the implementation? Something that could need quite a bit of thought, but one option is the obvious inclusion of a sequence header in the XML message.

[identity profile] sbisson.livejournal.com 2002-07-08 01:48 am (UTC)(link)
After seeing another session where the latency issue was dealt with by including Kerberos tickets in the SOAP headers, I'm pretty sure that that is the appropriate way of dealing with the integrity issue as well as the idempotence problem...