How to set proxy while using camel-http -


i new camel, , ended stucked on proxy problem. have such route use store resulat recurrent http call file:

from("quartz://collector/test?cron=0+0/2+*+?+*+*")                           .setheader(exchange.http_method, constant("get"))         .setheader(exchange.http_query, constant("id=50") .to("http://www.anywebsite/question.php")     .setheader(exchange.file_name,constant("${date:now:yyyymmddhhmmsssss}.xml")) .inonly(somefolder); 

my problem need specify proxy (host + port) go through or i'll stucked trying information. tried various ways, including setting "http.proxyhost" , ""http.proxyport" routebuilder (through getcontext().setproperties) , bundle-context.xml wrapped in "properties/property" tag. tried set in endpoint (the camel-http doc saying can set httpenpoint) adding &proxyhost=myhost&proxyport=myport it.

none worked..

il tried set http-conduit posts read through google such (choosing 1 or other according deployment target):

<http-conf:conduit name="*.http-conduit"> <!-- when behind proxy -->         <http-conf:client connection="close" connectiontimeout="3000" receivetimeout="10000" proxyserver="p-goodwat" proxyserverport="3128"/>  <!-- when no proxy -->     <http-conf:client connection="close" connectiontimeout="3000" receivetimeout="10000" /> </http-conf:conduit> 

but didn't work either... , also, able automatically, without having update camel-context according installed.

so, see way set it, , set dynamically?

after few attemps, managed have worked... looks problem did not come solution, fact did not increment bundle version... thus, solutions not taken consideration.

so, solution worked me setting endpoint context routebuilder, : getcontext().setproperty("http.proxyhost",10.100.100.1);
getcontext().setproperty("http.proxyport",2111);

now, work.

thanks had look!


Comments