...
The Point-to-Point Channel EIP pattern ensures that only a single receiver consumes a message (when there are multiple receivers waiting to consume the message). For more information, see Point to Point Channel.
...
Figure 1: Point-to-Point Channel EIP
Example scenario
The example scenario uses an inventory of stocks. It illustrates how a stock quote is generated, which only a single consumer receives at a given time. The diagram below depicts how this example is simulated using the ESBfollowing diagram depicts an example scenario that is carried out using the ESB. As shown below, there are three instances of the Stock Quote service connected to the ESB as consumers. The client application requests a stock quote from the stock inventory service (Stock Quote service). The ESB receives the messages sent from the client and routes each message to a single consumer (single Stock Quote service instance) at a time.
Figure 2: Example scenario of the Point-to-Point Channel EIP
...
Code Block |
---|
<definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy xmlns="http://ws.apache.org/ns/synapse" name="PointToPointProxy" transports="http https" startOnLoad="true" > <target> <inSequence> <send> <endpoint> <!-- Channel With Multiple Endpoints Load Balancer Will Ensure that only one will receive it --> <loadbalance> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService/" /> </endpoint> <endpoint> <address uri="http://localhost:9001/services/SimpleStockQuoteService/" /> </endpoint> <endpoint> <address uri="http://localhost:9002/services/SimpleStockQuoteService/" /> </endpoint> </loadbalance> </endpoint> </send> </inSequence> <outSequence> <respond/> </outSequence> </target> </proxy> </definitions> definitions> |
The configuration elements
...