We are using Camel HTTP4 endpoint for calling to external webservice. The
connection time out and read time are provided thru the endpoint options,
like below.

/http4://api.webservice.com?httpClient.soTimeout=200;httpClient.connectionTimeout=200/


The camel route from which this endpoint calls contain following 3 tasks;

i) set a camel header using <camel:setHeader headerName="xxxxx.category"> 
// used for logging purpose
ii) calling above http4 endpoint 
iii) Remove the above header using <camel:removeHeader
headerName="xxxxx.category">

We are using Camel's *EventNotifierSupport *for logging purpose, especially
to log the response time of external webservice calls. The application only
consider *ExchangeSentEvent *types and all other events will be discarded.
In addition the events will be filtered further based on the Message header
- to get notification only for external http4 calls. The application using
*/exchangeSentEvent.getTimeTaken()/* api and its value considered as the
response time of respective call. 

Even though the read time out is configured as 200 ms the external calls
with time more than 200 ms are not always failing or not throwing
SocketTimeOutException. The external calls are not throwing any
SocketTimeOutException when exchangeSentEvent.getTimeTaken() value is
204/208/211 etc..., but there are cases the SocketTimeOutException happens
when exchangeSentEvent.getTimeTaken() value is 200+ ms. To sum up, whenever
any SocketTimeOutException occurs the value of
exchangeSentEvent.getTimeTaken() is above 200 ms, but the value of
exchangeSentEvent.getTimeTaken() is above 200 ms its not mandatory to happen
SocketTimeOutException!

Could anyone guide how can we calculate the accurate read time of a http4
call? To handle the timeout properly.
Whether the exchangeSentEvent.getTimeTaken() include any buffer time like
pre & post processing of camel exchange ?
Is there anyway to know the accurate time taken for connection & read when
using a httpendpoint?

Apache Camel version - 2.12.1
camel-http4 version - 2.12.1

Please advise.





--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTP4-Endpoint-Read-time-out-behavior-is-strange-tp5781169.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to