camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desenfoque <csan...@gmail.com>
Subject TimeOut in ConsumerTemplate not working (Takes forever)
Date Wed, 03 May 2017 18:45:55 GMT
Hi.

I have a processor with this ConsumerTemplate:

ConsumerTemplate consumerCorr =
exchange.getContext().createConsumerTemplate();
String URI_CORR = http://10.100.7.4:8080/ServiciosRest/rest/correlativo/get

*String respCorr = consumerCorr.receiveBody(URI_CORR,10000,String.class);*


I'm expecting a 10 seconds timeout, but I have to wait a lot (several
minutes) and I get this Exception

*org.apache.camel.RuntimeCamelException: java.net.ConnectException:
Connection timed out

  at
org.apache.camel.component.http.HttpPollingConsumer.doReceive(HttpPollingConsumer.java:97)[org.apache.camel:camel-http:2.15.1.redhat-620133]*


but I was expecting a *null * because the documentation says that:

<String> String org.apache.camel.ConsumerTemplate.receiveBody(String
endpointUri, long timeout, Class<String> type)

Receives from the endpoint, waiting until there is a response or the timeout
occurs
Type Parameters:
<T>
Parameters:endpointUri the endpoint to receive from
timeout timeout in millis to wait for a response
type the expected response type

*Returns:the returned response body, or null if no response*


What is happening? I'm using the ComsumerTemplate wrong??



--
View this message in context: http://camel.465427.n5.nabble.com/TimeOut-in-ConsumerTemplate-not-working-Takes-forever-tp5798621.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message