You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by takidean <ta...@hotmail.fr> on 2013/03/28 17:44:36 UTC

Processor can't receive exchange !

hi 
everything goes well with my jdbc connection and my routes but i have to
receive data from my exchange i don't know where is the problem with my
processor here

    public void configure() {
   /* 	from("file:src/data?noop=true")
                .to("jms:queue:Orders")
                 .bean(OrderToOracle.class, "toSql")
                  .to("jdbc:ds");*/
    	   from("file:src/data?noop=true")
           .choice()
               .when(xpath("/person/city = 'London'"))
.setBody().constant("SELECT * FROM `examen`.`user` WHERE `user`.`name` =
'tt';")

               .to("jdbc:ds").process(new Processor() {
				
				@Override
				public void process(Exchange exchange) throws Exception {


					List<Map&lt;String, Object>> data =
exchange.getOut().getBody(List.class);
					Map<String, Object> row = data.get(0);
					System.out.println("*********************nom="+row.get("lastname")) ;
				}
			})
               

               .otherwise()
                   .to("file:target/messages/others");

                        }



--
View this message in context: http://camel.465427.n5.nabble.com/Processor-can-t-receive-exchange-tp5730048.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Processor can't receive exchange !

Posted by Christian Müller <ch...@gmail.com>.
Try exchange.getIn() instead of exchange.getOut().

Sent from a mobile device
Am 28.03.2013 20:23 schrieb "takidean" <ta...@hotmail.fr>:

> hi
> everything goes well with my jdbc connection and my routes but i have to
> receive data from my exchange i don't know where is the problem with my
> processor here
>
>     public void configure() {
>    /*   from("file:src/data?noop=true")
>                 .to("jms:queue:Orders")
>                  .bean(OrderToOracle.class, "toSql")
>                   .to("jdbc:ds");*/
>            from("file:src/data?noop=true")
>            .choice()
>                .when(xpath("/person/city = 'London'"))
> .setBody().constant("SELECT * FROM `examen`.`user` WHERE `user`.`name` =
> 'tt';")
>
>                .to("jdbc:ds").process(new Processor() {
>
>                                 @Override
>                                 public void process(Exchange exchange)
> throws Exception {
>
>
>                                         List<Map&lt;String, Object>> data =
> exchange.getOut().getBody(List.class);
>                                         Map<String, Object> row =
> data.get(0);
>
> System.out.println("*********************nom="+row.get("lastname")) ;
>                                 }
>                         })
>
>
>                .otherwise()
>                    .to("file:target/messages/others");
>
>                         }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Processor-can-t-receive-exchange-tp5730048.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>