Skip to Content
Technical Articles
Author's profile photo Bhalchandra Wadekar

EIPinCPI – Point-to-Point Channel

Previous – Message Channel | Index | Next – Publish-Subscribe Channel

This week, we’ll study a pattern known as Point-to-Point Channel.

When do I use this pattern?

A Point-to-Point channel is used when the sender intends to send the message to exactly one receiver. For example, sending orders from Order Management System to an Enterprise Resource Planning system. In this example, the receiver is only one – ERP system. When multiple receivers are involved, a Point-to-Point channel ensures that only one receiver receives the message.

Point-to-Point Channel in CPI

In CPI, I’ll use JMS Sender Adapter and JMS Receiver Adapter to demonstrate the pattern. Let’s use Northwind OData Service to act as Order Management System. Also, instead of sending the order to an actual ERP System, I’ll simply log the payload.

Integration Flow – Sending an Order to the Channel

Sending%20an%20Order%20to%20Channel

Sending an Order to the Channel

The Integration Flow starts with a Timer Start Event, gets the Order from Northwind OData Service using a Request-Reply component and OData Receiver Adapter. Finally, the Order is sent to a Point-to-Point channel using JMS Receiver Adapter.

Configuration of OData Receiver Adapter:

Tab Property Value
Connection Address https://services.odata.org/V2/Northwind/Northwind.svc
Connection CSRF Protected Unchecked
Processing Operation Details Query (GET)
Processing Resource Path Orders
Processing Query Options $top=1

Configuration of JMS Receiver Adapter:

Tab Property Value
Processing Queue Name Orders

Integration Flow – Receiving an Order from the Channel

Receiving%20an%20Order%20from%20the%20Channel

Receiving an Order from the Channel

The integration flow picks up the Order from the channel and logs for monitoring.

The JMS Sender Adapter is configured as follows:

Tab Property Value
Connection
Queue Name Orders
Connection
Number of Concurrent Processes 2

I am setting the Number of Concurrent Processes to 2 to demonstrate that the Order gets logged only once.

Output

The first flow puts the Order message in the queue like so:

Sending%20to%20the%20Channel

Sending to the Channel

Although the second flow has Competing Consumers, the message is only logged once.

Receiving%20from%20the%20Channel

Receiving from the Channel

 

EIPinCPI Rating – 10/10

The EIPinCPI rating of 10 out of 10 is justified by the strong support for JMS in CPI. The rating is the same as that for Message Channel pattern.

Conclusion

Point-to-Point channel is used when the sender intends to send the message to exactly one receiver. CPI supports the patterns through JMS.

References/Further Readings

Hope this helps,
Bala

Previous – Message Channel | Index | Next – Publish-Subscribe Channel

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.