...
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.
Point-to-Point using XML DSL:
Demonstration of point-to-point message with JMS components.
Code Block | ||
---|---|---|
| ||
<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:
...
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:
...