camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thelonesquirrely <>
Subject Creating Postal Service using Camel
Date Fri, 30 Sep 2011 21:18:39 GMT
Hello - 

I need to make a postal service (point-to-point (direct) and publish (topic)
essentially). I was thinking that I could leverage most of the work that
camel has but I am a little confused.

Mainly I am having a problem dealing with the topic. I have an endpoint
defined as such: 

  <bean id="activemq"
    <property name="brokerURL" value="vm://localhost" />

and I have a route defined as such (in Java DSL) : 

  public void configure () throws Exception {
    from ("activemq:topic:catcher").bean (Catcher.class);

simple right? The catcher class just has on method: 

public class Catcher implements MessageListener {
  public void onMessage (Message jmsMsg) {
    System.out.println (toString () + "-Recieved Message: " + jmsMsg);

and something publishes a simple string to the topic: 
      // get the camel context using the CamelContextAware interface
      pTemplate.sendBody ("activemq:topic:catcher", new TestMessage (msg));

Then I have 3 catchers in the Spring context (Did i mention I was using
Spring?). None of these three are notified actually. It is a 4th that
presumably gets created that is notified. 

How would I arrange it so that the 3 get notified? Would I need to have them
each register their own route?  I want to try and encapsulate the routing
information in the PostalService - identify/describe/control the routes
there. I am open to suggestions! I am really just starting to look into this
and camel is...intimidating. Thanks!

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message