In SAP PI, you can define two types of communication — Synchronous and Asynchronous.
Synchronous communication is invoked by request and response operation and process output is returned immediately after the operation. In general terms, you can say that a synchronous scenario is when a sender process sends a request to the receiver and waits for a response. If an error occurs at the receiver side, the sender application is responsible for sending the message again.
In this approach, there is a possibility that the sender might resend the message after time out and a duplicate message may exist. This approach in PI is known as BE (Best Effort).
Consider two systems – A and B. And, you introduce an intermediate system I between the two systems. Communication between System A and System I is synchronous and System A and System B is asynchronous.
The following types of errors can occur in this communication scenario −
Application Error − There is an error at the receiver end while processing a message and the sender is not aware about this error and keeps waiting for the reply.
Network level Error − In this error, there is an error in communication network between the sender and the receiver. Sender is not aware about this and the message is stuck in between and the sender waits till the operation timeout.
Error in Response Message − In this scenario, an error occurs and the response message gets stuck in between and sender keeps on waiting.
The following are the key advantages of using Synchronous Communication −
There is no need to configure response message routing.
There is no need to correlate response to a request.
In this communication, response is received immediately.
This is suitable for operations that involve read operations, for example, viewing a purchase order.
The following are the key disadvantages of using Asynchronous Communication −
In case of a failure, the sender needs to send a message again.
The receiving system should be configured to check duplicate messages.
In this scenario, the sender application is blocked till a response is received or a time out error occurs.
You can’t configure multiple receivers.
In Asynchronous Communication, you add an intermediate system or a middleware between two systems. When a Sender Application sends a request, it does not wait for the Receiver Application to send the response. If there is a failure due to some reason, the middleware is responsible for resending the message. If required, the receiving system can send a response back to Sender as a separate asynchronous call.
This approach in SAP PI is called Exactly Once (EO) or Exactly Once in Order (EOIO).
An intermediate system is a queue and message from A is first added to the queue and at receiver end, it is pulled from queue and send to receiver. The response message from system B follows the
You can also maintain order in certain situations as per business requirement by using First In First Out (FIFO). This scenario is called Asynchronous with order maintained or Exactly Once in Order (EOIO).
Asynchronous communication assures guaranteed delivery. If the receiver system is not available for sometime, then the intermediate queue keeps the message and it remains there till the receiver system is available and the message is pulled from queue and sent to receiver system.
This is recommended for modify operations like creating a purchase order or modify a purchase order
The following are the key advantages of asynchronous communication −
In case of failure, the SAP PI system ensures guaranteed delivery and will resend the message.
No configuration required for duplicate checks.
You can configure multiple receivers in this scenario.
Both the sender system and the receiver system need not be online at same time.
PI logs all the messages sent via asynchronous communication.
No time out as intermediate system keeps the message and response request.
The following are the key disadvantages of asynchronous communication −
In this scenario, the sender needs to correlate responses to request on its own.
Response message