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: Get full request url from Exchange
Date Thu, 24 Jan 2013 08:32:33 GMT
On Wed, Jan 23, 2013 at 10:10 PM, Pranab Mehta <rouble@gmail.com> wrote:
> I am running Camel 2.8, and to proxy a https web service I use the
> following route:
>         from("servlet:///proxyWebService/api/?matchOnUriPrefix=true")
>         .process(myProcessor)
>         .to("https4://realWebService:8443/api/?bridgeEndpoint=true&throwExceptionOnFailure=false");
>
> Now, in the process leg, I want to be able to extract the full Request
> URL with hostname and port that was used to access the servlet. I am
> hoping this information is somewhere in the Exchange, but I am unable
> to find it.
>

You can get access to the HttpServletRequest, where you can find all
the details you need.

In the processor you can do

HttpMessage msg = exchange.getIn(HttpMessage.class);
HttpServletRequest req = msg.getRequest();


> tia,
> rouble



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message