Publish Subscribe Channel

Camel supports the Publish Subscribe Channel from the EIP patterns using the following components

  • JMS for working with JMS Topics for high performance, clustering and load balancing
  • XMPP when using rooms for group communication

Using Routing Logic

Another option is to explicitly list the publish-subscribe relationship in your routing logic; this keeps the producer and consumer decoupled but lets you control the fine grained routing configuration using the DSL or Xml Configuration.

Using the Fluent Builders

RouteBuilder builder = new RouteBuilder() {
    public void configure() {
        from("queue:a").to("queue:b", "queue:c", "queue:d");
    }
};

Using the Spring XML Extensions

<camelContext id="buildStaticRecipientList" xmlns="http://activemq.apache.org/camel/schema/spring">
   <route>
     <from uri="queue:a"/>
     <to>
        <uri>queue:b</uri>
        <uri>queue:c</uri>
        <uri>queue:d</uri>
     </to>
   </route>
</camelContext>

Using This Pattern

If you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out.

Graphic Design By Hiram