FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture Blog: Reliable Messaging, Transactions, and Messages (take 2.5)
Architecture & Design
PATTERN LANGUAGE

Modeling, Managing, Making it Right.

by Jonathan Erickson
IF YOU BUILD IT

... Will they Come?

by Arnon Rotem-Gal-Oz
July 19, 2006

Reliable Messaging, Transactions, and Messages (take 2.5)

Udi and Eric, a couple of my fellow Dr. Dobb's bloggers, exchanged comments on the topic of "reliable messaging" and "transactions" over at Ud's blog, so I thought I might as well jump in too.

Regarding reliable messaging: Eric commented that reliable messages should always be used, although Udi thought that it isn't always the case. I would add that another reason for not using reliable messages everywhere (besides cyclic messages, as mentioned by Udi) is inter-business communications or even the lack of homogeneous infrastructure within an organization. You can't always count on the other side to support reliable messaging and if you are using web services it is even harder (WS-ReliableMessaging is more like TCP vs. UDP and not store-and-forward). Nevertheless, you'd probably want to encourage idempotent messages in either case.

Regarding transactions: Udi said that "transactional behavior is already defined by the recoverability description [of the message ARGO]. A recoverable message should be handled within a transaction". I think you should be careful with this since if the transport you worked with is not transactable, your reading transaction can rollback. However, the message--reliable as it is may be--would be gone. In this case, you have to becareful about making the message transaction like by "bringing your own transaction" (i.e., compensation logic) or work with a transactable resource.

Posted by Arnon Rotem-Gal-Oz at 05:02 AM  Permalink




 
INFO-LINK