Look at the HTTP4 component. Jut call it inline:

 .when(xpath("//oprncode = 'ATM'"))
.setHeader(Exchange.HTTPQuery, simple("..... stuff here ..... "))
.to("http4://www.myhost.org:8020").endChoice()

Generally with camel if your task is not unique to your process or unique
to your domain, then there is little reason to write a processor. Instead
there is most likely a way to do it with camel. Calling HTTP inside a route
is an every day thing for camel.


*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Thu, Feb 13, 2014 at 4:01 AM, arko1983 <[email protected]> wrote:

> I have two REST url's one to check rest url for options second to process
> from another rest url.
>
>
> i want to route first url "returnu" through xpath and then call another
> rest
> service url "query url" and process it
>
>
> Code snippet are as follows.
> try {
>                         context.start();
>
> RouteBuilder builder=new RouteBuilder() {
>                         @Override
>                         public void configure() throws Exception {
>                                 from(returnU)
>                                 .choice()
>                                     .when(xpath("//oprncode = 'ATM'"))
>  ///////////here i want to call
> another rest url and process it after it has cleared the condition of the
> xpath/////////
>                                          .process(new Processor() {
> ////process
>                                                         })
>                         .when(xpath("//oprncode = 'NETB'"))
>                             .to("direct:b")
>                         .when(xpath("//oprncode = 'REPT'"))
>                             .to("direct:c")
>                         .otherwise()
>                             .process(new Processor() {
>
>                                                         @Override
>                                                         public void
> process(Exchange data) throws Exception {}
>                                                 });
>                         }
>                 };
>                 context.addRoutes(builder);
>
>                 }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/routing-with-camel-tp5747239.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to