Guest User

Untitled

a guest
Jul 4th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. import org.apache.activemq.camel.component.ActiveMQComponent;
  2. import org.apache.camel.CamelContext;
  3. import org.apache.camel.builder.RouteBuilder;
  4. import org.apache.camel.impl.DefaultCamelContext;
  5. import org.apache.log4j.Logger;
  6.  
  7. public class CamelJmsMain {
  8.  
  9.     private static Logger log = Logger.getLogger(CamelMain.class);
  10.  
  11.     public static void main(String[] args) throws Exception {
  12.  
  13.         log.info("Starting application");
  14.         CamelContext context = new DefaultCamelContext();
  15.         context.addComponent("activemq", ActiveMQComponent.activeMQComponent("tcp://localhost:61616"));
  16.         context.addRoutes(new RouteBuilder() {
  17.             @Override
  18.             public void configure() throws Exception {
  19.                 from("activemq:test").to("log:output");
  20.             }
  21.         });
  22.         context.start();
  23.  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment