camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Pojo @Consumer Annotation
Date Wed, 17 Jun 2015 06:25:25 GMT
Ah its the timer that sends an empty body. The timer always sends a null body.

The @Consume is for POJO routing where you do not need to write a Camel route.
So for example remove the route with the timer.

Though to bootstrap the @Consumer it depends a bit how you run Camel.
To have the @Consume being detected by Camel that creates the consumer
and calls the bean.

See this example
http://camel.apache.org/pojo-messaging-example.html

On Wed, Jun 17, 2015 at 8:21 AM, kalber <Karlheinz.Alber@swslt.com> wrote:
> Done,
>
> in.body is still null.
>
> Route :
> ---------
> from("timer://?repeatCount=1").bean(MyService.class)
>
> Bean
> --------
> public class MyService {
>
>  @Consume(uri = "sql: select codaz, codbus, logmsg from bus.buslogger where
> loglev = 'STS_CFG'?dataSource=#dataSource.nagios")
>     public void process(Exchange exchange) {
>         System.out.println("wait");
>     }
> }
>
> I attached a screenshot, so you can see debug.
>
>
>
>
> -----
> kh
> --
> View this message in context: http://camel.465427.n5.nabble.com/Pojo-Consumer-Annotation-tp5768168p5768320.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message