Camel cxfrs RESTful клиент / ProducerTemplate ConnectionTimeout
Я пытаюсь установить 'connectionTimeout' для компонента Camel CXF-RSВоткоторый производит RESTful-запросы на сторонних сервисах. По умолчанию30000
миллисекунды это долго.
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);
}
});
Я попытался добавить это к нашемуapplication-context
как многие предлагали, но не вижу, как он изменяет значения по умолчанию при отладке черезHTTPConduit
а такжеHTTPClientPolicy
классы:
<http-conf:conduit name="*.http-conduit">
<http-conf:client ConnectionTimeout="5000"/>
</http-conf:conduit>
и я попытался добавить
"?httpClientAPI=true&connectionTimeout=5000"
в качестве параметров строки URL.
Любая помощь или руководство будет высоко ценится.