The Point-to-Point Channel EIP pattern allows only a single receiver to consume a sent message when there are multiple receivers waiting to consume it.
For more information, go to Point to Point Channel.
The following sections explain how you can implement a sample scenario of this EIP using the ESB profile of WSO2 EI.
The sample scenario is an inventory for stocks. It illustrates how a stock quote is generated, which only a single consumer receives at a given time. The diagram below depicts how to simulate the sample scenario using the ESB profile.
Simulating the sample scenario
Follow the below instructions to simulate this sample scenario.
Analyzing the output
Out of the three instances of the
Stock Quote service (Axis2 server), only one server acquires the sent request at a given time. When you execute the request, the ESB profile first receives the message and then routes it to the back-end service (StockQuoteService). The following output will be printed on the Axis2 Server Console:
The generated stock quote will then be sent to the client application (Stock Quote Client). The following output will be printed on the client application Console:
If you try sending multiple requests, the Console logs of each of the Axis2 server instances will display that the three of them are receiving the message one after the other (i.e., in Round Robin pattern).