Request and Reply

Request/reply is an important communication pattern. Proper use of this pattern places requirements on the runtime environment.

  • The replying process must be operational before the requesting process sends requests.
  • The transports that carry the requests and replies must have already established operational communications before either process sends a request or a reply.

Design programs to ensure robust behavior in situations where these requirements are not satisfied.

For example, a program that sends a request and then waits indefinitely for a reply is fragile. If the replying process is not available, or the transport’s communications are not operating, then the request message does not reach its intended recipient, and the requesting process does not receive any information about this failure.

A more robust program would repeat the request at intervals until it receives a reply, or until it exceeds some reasonable limit.