Camel cxfrs RESTful cliente / ProductorTemplate ConnectionTimeout
Estoy tratando de configurar el 'connectionTimeout' para un componente Camel CXF-RSaquíque produce solicitudes RESTful en un servicio de terceros. El valor por defecto30000
milisegundos es demasiado largo.
Exchange exchange = template.send("cxfrs://" + url, new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.setPattern(ExchangePattern.InOut);
Message inMessage = exchange.getIn();
setupDestinationURL(inMessage);
// using the http central client API
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
// set the Http method
inMessage.setHeader(Exchange.HTTP_METHOD, "PUT");
// set the relative path
inMessage.setHeader(Exchange.HTTP_PATH, url);
// Specify the response class , cxfrs will use InputStream as the response object type
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
// set a customer header
inMessage.setHeader("key", "value");
// since we use the Get method, so we don't need to set the message body
inMessage.setBody(null);
}
});
He intentado agregar esto a nuestroapplication-context
como muchos han sugerido, pero no pueden verlo modificando los valores predeterminados al depurar a través deHTTPConduit
yHTTPClientPolicy
clases:
<http-conf:conduit name="*.http-conduit">
<http-conf:client ConnectionTimeout="5000"/>
</http-conf:conduit>
y he intentado agregar
"?httpClientAPI=true&connectionTimeout=5000"
como opciones para la cadena de url.
Cualquier ayuda u orientación sería muy apreciada.