Cliente RESTful / ProducerTemplate ConnectionTimeout do camel cxfrs
Estou tentando definir o 'connectionTimeout' para um componente Camel CXF-RSaquique produz solicitações RESTful em um serviço de terceiros. O padrão30000
milissegundos é muito longo.
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);
}
});
Eu tentei adicionar isso ao nossoapplication-context
como muitos sugeriram, mas não conseguem vê-lo modificando os valores padrão ao depurar o arquivoHTTPConduit
eHTTPClientPolicy
classes:
<http-conf:conduit name="*.http-conduit">
<http-conf:client ConnectionTimeout="5000"/>
</http-conf:conduit>
e eu tentei anexar
"?httpClientAPI=true&connectionTimeout=5000"
como opções para a string do URL.
Qualquer ajuda ou orientação seria muito apreciada.