Let's Have a Conversation

Communicating inside a single program is trivial: one method calls another, the result comes back, and the calling method continues. If anything goes wrong, an exception is thrown. If the program aborts altogether, both caller and callee share the same fate, making the interaction an all-or-nothing affair. This kind of binary outcome is a welcome behavior in the predictive world of computer software, especially one that's based on 1s and 0s. In the land of loosely coupled distributed systems, things are a little more complicated. Using procedure call semantics for distributed systems is generally considered a bad idea, so systems should communicate in a more loosely coupled way - preferably by exchanging messages. Message-based communication results in a simple interaction model and, if used with message queues, temporal decoupling between sender and receiver: splitting the request-response interaction into two separate messages means that callers don't have to sit around waiting for response messages