You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kalyan <re...@gmail.com> on 2013/05/10 17:55:49 UTC

How to use camel servlet as httpproxy

Hello,

I'm currently working on Camel with JavaDSL.

what I would like to have is:

from("servlet:///route*").to("http://<anotherweb-app-address>/test/*?bridgeEndpoint=true")

I would like to have both the stars ("*") in from() and to() as same.

Is this possible ?

Regards,
Kalyan



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel servlet as httpproxy

Posted by kalyan <re...@gmail.com>.
Also I tried setting it by Exchange.HTTP_PATH with no luck as follows:

exchange.getIn().setHeader(Exchange.HTTP_PATH, path);



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732339.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel servlet as httpproxy

Posted by kalyan <re...@gmail.com>.
I noticed that there was a problem in stub implementation and so GET requests
were not working properly.

I don't think it is an issue with camel anymore.

However, I notice that Camel specifically removes Content-Type header for
GET requests even when the incoming request (to say "servlet:///test")
contains it. Probably because it is GET does not have a body and so it makes
no sense




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732415.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel servlet as httpproxy

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you have a small sample project as a .zip or .tar then if some
people have the time, they can take a look. Though no promises, as
most of us is busy with all sorts of work stuff.

The query parameters (assuming you refer to foo=bar&me=you, then they
ought to be transferred when bridging.

The servlet component is based on the same code as we use when
bridging with jetty etc.



On Sat, May 11, 2013 at 9:04 AM, kalyan <re...@gmail.com> wrote:
> Hello Claus,
>
> Thank you for the reply. However this option is is taking care of only PATH
> and not query params. Is there a way to instruct camel to cascade the query
> params as well ?
>
> Regards,
> Kalyan
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732312.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

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

Re: How to use camel servlet as httpproxy

Posted by kalyan <re...@gmail.com>.
Hello Claus,

Thank you for the reply. However this option is is taking care of only PATH
and not query params. Is there a way to instruct camel to cascade the query
params as well ?

Regards,
Kalyan



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732312.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use camel servlet as httpproxy

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah see also
http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html

On Fri, May 10, 2013 at 8:03 PM, kalyan <re...@gmail.com> wrote:
> Sorry for the lame question. The answer is at  camel-servlet documentation
> <http://camel.apache.org/servlet.html>  .
>
> I needed from("servlet:///hello?matchOnUriPrefix=true")
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732300.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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

Re: How to use camel servlet as httpproxy

Posted by kalyan <re...@gmail.com>.
Sorry for the lame question. The answer is at  camel-servlet documentation
<http://camel.apache.org/servlet.html>  . 

I needed from("servlet:///hello?matchOnUriPrefix=true")



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-camel-servlet-as-httpproxy-tp5732297p5732300.html
Sent from the Camel - Users mailing list archive at Nabble.com.