Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

However, if there happen to be multiple receivers that try to consume an individual message, then the channel will ensure that only one of them will be successful. With this level of guarantee, none of the receivers have to coordinate their actions with each other.

Table of Contents

The channel can still have multiple receivers to consume multiple messages concurrently, while the channel enforces the rule that only a single receiver consumes any one message.Image Removed

Image Added

Point-to-Point using XML DSL:

Demonstration of point-to-point message with JMS components.

Code Block
languagexml
<routes>
    <route>
        <from uri="direct:begin"/>
        <to uri="jms:queue:hello"/>
    </route>
    <route>
        <from uri="jms:queue:hello"/>
        <to uri="bean:hello"/>
    </route>
</routes>

Components that Support Point-to-Point Channel

The following Apache Camel components support the point-to-point channel pattern:

  • JMS

  • ActiveMQ

  • SEDA

  • JPA

  • XMPP

JMS Point-to-Point

In JMS, a point-to-point channel is represented by a queue. For example, you can specify the endpoint URI for a JMS queue called Foo.Bar as follows:

Code Block
jms:queue:Foo.Bar

NOTE: The qualifier of the queue, is optional because the JMS component creates a queue endpoint by default.

SEDA

This is the Apache Camel Staged Event-Driven Architecture (SEDA) component, and it is implemented using a blocking queue. We will use the SEDA component when you want to create a lightweight point-to-point channel that is internal to the Apache Camel application. For example, you can specify an endpoint URI for a SEDA queue called mySedaQueue as follows:

Code Block
seda:mySedaQueue

ActiveMQ

In ActiveMQ, a point-to-point channel is represented by a queue. For example, you can specify the endpoint URI for an ActiveMQ queue called Foo.Bar as follows:

Code Block
activemq:queue:Foo.Bar