How do you create that bean?

You need to create it via Camel to have Camel detect those annotations

There is an Injector on CamelContext you can use to create a new
instance of the bean

On Mon, Jul 8, 2019 at 9:35 AM chege <[email protected]> wrote:
>
> 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.
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to