You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by arnaud <ar...@free.fr> on 2015/08/12 11:40:35 UTC
Getting query parameters from jetty and put then in restlet
endpoint
Hello,
I try to get parameters from jetty endpoint to the restlet but it seems that
this is not the right way :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1=${in.headers.param1}¶m2=${in.headers.param2}&restletMethod=get");
How can I pass my parameters?
Thanks,
Arnaud
--
View this message in context: http://camel.465427.n5.nabble.com/Getting-query-parameters-from-jetty-and-put-then-in-restlet-endpoint-tp5770602.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Getting query parameters from jetty and put then in restlet
endpoint
Posted by arnaud <ar...@free.fr>.
Hi Greg,
With the following code :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1=(param1)¶m2=(param2)&restletMethod=get");
I get an url like that in the log :
http://localhost:20010/services/getInfos?param1=ENFR¶m2=130.008¶m1=%28param1%29¶m2=%28param2%29
I have found something that works :
from("jetty:http://0.0.0.0:8081/myapp/myservice2?param1={param1}¶m2={param2}")
.setHeader("CamelHttpQuery",
simple("param1=${header.param1}¶m2=${header.param2}"))
.to("restlet:http://localhost:20010/services/getInfos?&restletMethod=get");
I'm not sure this is the best way, bu it works.
Thanks for your help.
Arnaud
--
View this message in context: http://camel.465427.n5.nabble.com/Getting-query-parameters-from-jetty-and-put-then-in-restlet-endpoint-tp5770602p5770707.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Getting query parameters from jetty and put then in restlet
endpoint
Posted by Greg Autric <ga...@redhat.com>.
Sorry
it is parenthesis
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1=(param1)¶m2=(param2)&restletMethod=get");
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
Red Hat Global Services
Red Hat France SARL sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail
----- Mail original -----
De: "Greg Autric" <ga...@redhat.com>
À: users@camel.apache.org
Envoyé: Jeudi 13 Août 2015 15:06:36
Objet: Re: Getting query parameters from jetty and put then in restlet endpoint
Hi Arnaud,
Please take a look here https://github.com/apache/camel/blob/master/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletProducer.java#L147
this camel route should work correctly/directly :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1={param1}¶m2={param2}&restletMethod=get");
Best regards,
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
Red Hat Global Services
Red Hat France SARL sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail
----- Mail original -----
De: "arnaud" <ar...@free.fr>
À: users@camel.apache.org
Envoyé: Mercredi 12 Août 2015 11:40:35
Objet: Getting query parameters from jetty and put then in restlet endpoint
Hello,
I try to get parameters from jetty endpoint to the restlet but it seems that
this is not the right way :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1=${in.headers.param1}¶m2=${in.headers.param2}&restletMethod=get");
How can I pass my parameters?
Thanks,
Arnaud
--
View this message in context: http://camel.465427.n5.nabble.com/Getting-query-parameters-from-jetty-and-put-then-in-restlet-endpoint-tp5770602.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Getting query parameters from jetty and put then in restlet
endpoint
Posted by Greg Autric <ga...@redhat.com>.
Hi Arnaud,
Please take a look here https://github.com/apache/camel/blob/master/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletProducer.java#L147
this camel route should work correctly/directly :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1={param1}¶m2={param2}&restletMethod=get");
Best regards,
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
Red Hat Global Services
Red Hat France SARL sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail
----- Mail original -----
De: "arnaud" <ar...@free.fr>
À: users@camel.apache.org
Envoyé: Mercredi 12 Août 2015 11:40:35
Objet: Getting query parameters from jetty and put then in restlet endpoint
Hello,
I try to get parameters from jetty endpoint to the restlet but it seems that
this is not the right way :
from("jetty:http://localhost:8081/myapp/myservice?param1={param1}¶m2={param2}")
.to("restlet:http://localhost:20010/services/getInfos?param1=${in.headers.param1}¶m2=${in.headers.param2}&restletMethod=get");
How can I pass my parameters?
Thanks,
Arnaud
--
View this message in context: http://camel.465427.n5.nabble.com/Getting-query-parameters-from-jetty-and-put-then-in-restlet-endpoint-tp5770602.html
Sent from the Camel - Users mailing list archive at Nabble.com.