Point to Point Channel

Camel supports the Point to Point Channel from the EIP patterns.

An application is using Messaging to make remote procedure calls (RPC) or transfer documents.

How can the caller be sure that exactly one receiver will receive the document or perform the call?

image

Send the message on a Point-to-Point Channel, which ensures that only one receiver will receive a particular message.

The Point to Point Channel is supported in Camel by messaging based Components, such as:

  • AMQP for working with AMQP Queues

  • ActiveMQ, or JMS for working with JMS Queues

  • SEDA for internal Camel seda queue based messaging

  • Spring RabbitMQ for working with AMQP Queues (RabbitMQ)

There is also messaging based in the cloud from cloud providers such as Amazon, Google and Azure.

See also the related Publish Scribe Channel EIP

Example

The following example demonstrates point to point messaging using the JMS component:

  • Java

  • XML

from("direct:start")
    .to("jms:queue:foo");

from("jms:queue:foo")
    .to("bean:foo");
<routes>
    <route>
        <from uri="direct:start"/>
        <to uri="jms:queue:foo"/>
    </route>
    <route>
        <from uri="jms:queue:foo"/>
        <to uri="bean:foo"/>
    </route>
</routes>