Hi This has been debated recently. I suggest to search this forum to find that talk and the answer is there.
On Thu, Jan 30, 2014 at 7:42 AM, Manisha <[email protected]> wrote: > The issue is: > > We have set httpClient.soTimeout for HTTP requests but it is not working. We > are using Spring DSL. > > 1. It is added as a query parameter in a processor and set to HTTP_QUERY or > HTTP_PATH . It is appended to the request but timeout is not applicable. > > String httpTimeout = "?httpClient.soTimeout=1000"; > exchange.getIn().setHeader(Exchange.HTTP_PATH, getUri() + httpTimeout); > > or > > String httpTimeout = httpClient.soTimeout=1000; > exchange.getIn().setHeader(Exchange.HTTP_PATH, getUri()); > exchange.getIn().setHeader(Exchange.HTTP_QUERY,httpTimeout); > > using http4 component in enrich as: > <enrich uri="http4://anyuri" strategyRef="anyStrategy"/> > > 2. We tried HttpClientConfigurer also, even it is not working. > as > exchange.getIn().setHeader(Exchange.HTTP_QUERY,"httpClientConfigurer=anyHttpConfigurer"); > and define anyHttpConfigurer in .xml file. > > import org.apache.camel.component.http4.HttpClientConfigurer; > import org.apache.http.client.HttpClient; > import org.apache.http.params.CoreConnectionPNames; > > > public class AnyHttpConfigurer implements HttpClientConfigurer { > > @Override > public void configureHttpClient(HttpClient httpClient) { > if (httpClient.getParams() != null) { > > httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, > 1000); > > httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,1000); > > } > } > } > > Please help why httpClient.soTimeout is not working ? > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-httpClient-soTimeout-is-not-working-on-http4-tp5746609.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io
