Bootstraping Apache Camel - Main Method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bootstraping Apache Camel - Main Method

chege
Hi,

I've boostraped apache camel like below.

 public static void main(String... args) throws Exception {
        Main main = new Main();
        main.run(args);
        ProducerTemplate template = main.getCamelTemplate();
        template.sendBody("direct://k", 2);
}

I have another bean with a method annotated with @Consumes which is
never invoked.

public class MyBean {

    @Consume(context = "camel-1",uri="direct://k")
    public void k(@Body Integer k) {
        System.out.println("This is k " + k);
    }

}

How do I get pojo consumer to work?

Thanks,
Chege.