Asynchronous Communication: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 10: Line 10:
=Benefits of Asynchronous Communication=
=Benefits of Asynchronous Communication=
* Sending logic is simpler when a response is not expected. The client simply sends the message and moves on. The fact that the API method used to send the message returns without error is a confirmation that the message broker accepted the responsibility of delivering the message. The flip side is that the processing logic is more complex when a response '''is''' expected.
* Sending logic is simpler when a response is not expected. The client simply sends the message and moves on. The fact that the API method used to send the message returns without error is a confirmation that the message broker accepted the responsibility of delivering the message. The flip side is that the processing logic is more complex when a response '''is''' expected.
* The sending logic is decoupled from the processing of the message.
* The sending logic is decoupled from the processing of the message, which usually means that the sender can do other things while the message is being processed.


=Challenges of Asynchronous Communication=
=Challenges of Asynchronous Communication=

Revision as of 17:11, 5 October 2023

Internal

Overview

Asynchronous communication is a communication model used by distributed systems where a sender produces data, also referred to as message, and hands it over to delivery to an intermediate system, not expecting an immediate response to it. The message can reach zero, one or more receivers. Asynchronous communication is fundamentally different from its synchronous counterpart in that the application thread that sends the message does not block waiting for an answer, but it can move onto performing additional processing.

A response may not be expected at all, and when it is expected, additional logic must be deployed to receive and handle it.

Benefits of Asynchronous Communication

  • Sending logic is simpler when a response is not expected. The client simply sends the message and moves on. The fact that the API method used to send the message returns without error is a confirmation that the message broker accepted the responsibility of delivering the message. The flip side is that the processing logic is more complex when a response is expected.
  • The sending logic is decoupled from the processing of the message, which usually means that the sender can do other things while the message is being processed.

Challenges of Asynchronous Communication

Systems