I tried below code but it didn't work.

public class MyConfig {

    @BindToRegistry("myBean")
    public MyBean myBean() {
        return new MyBean();
    }

}

On Mon, 2019-07-08 at 09:50 +0200, Claus Ibsen wrote:
> 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.
> >
>
>

Reply via email to