私はラクダにかなり慣れていないので、問題に悩まされています。
cxf エンドポイントを使用して動的 Web サービス プロキシ (動作中) を作成しようとしています。Java DSL を使用して cxf エンドポイントのタイムアウトを設定する方法がわからないことを除けば、すべてうまくいっています。
Spring 構成を使用してそれを行う方法に関する多くの記事を見つけましたが、Java DSL のみを使用してこれを達成しようとしています。
これが私が現在持っているものです。Java DSLを使用してCXFタイムアウト(接続/受信)を操作する方法について、誰かが正しい方向に向けてください。
public void configure() throws Exception
{
onException(Exception.class).handled(true).transform()
.method(MyExceptionHandler.class, "handleException");
CxfEndpoint inboundCxf = new CxfEndpoint();
inboundCxf.setAddress(soapProxyConfig.getBaseUrl()
+ soapProxyConfig.getAddress());
inboundCxf.setCamelContext(camelContext);
inboundCxf.setDataFormat(DataFormat.RAW);
inboundCxf.setServiceName(new QName(soapProxyConfig
.getTargetNamespace(), soapProxyConfig.getRemoteServiceName()));
inboundCxf.setPortName(new QName(soapProxyConfig.getTargetNamespace(),
soapProxyConfig.getRemotePortName()));
inboundCxf.setWsdlURL(soapProxyConfig.getRemoteWsdl());
SedaEndpoint sedaEndpoint = new SedaEndpoint();
sedaEndpoint.setConcurrentConsumers(100);
sedaEndpoint.setExchangePattern(ExchangePattern.InOut);
sedaEndpoint.setSize(100);
sedaEndpoint.setCamelContext(camelContext);
sedaEndpoint.setEndpointUriIfNotSpecified("seda:" + routeId + "-Queue");
Endpoint[] remoteEndpoints = new Endpoint[soapProxyConfig
.getRemoteUrls().size()];
for (int i = 0; i < soapProxyConfig.getRemoteUrls().size(); i++)
{
Endpoint endpoint = camelContext.getEndpoint(soapProxyConfig
.getRemoteUrls().get(i));
endpoint.setCamelContext(camelContext);
remoteEndpoints[i] = endpoint;
}
from(inboundCxf).routeId(routeId)
.routePolicy(new WebServiceRoutePolicy()).to(sedaEndpoint);
from(sedaEndpoint).routeId(routeId + "-Queue").loadBalance()
.roundRobin().to(remoteEndpoints).id("Out");