0
我对骆驼很陌生并且遇到问题。骆驼用Java DSL设置CXF超时
我正在尝试使用cxf端点创建动态Web服务代理(正在工作)。除了我不知道如何使用Java DSL设置cxf端点超时之外,一切都进展顺利。
我发现了许多关于如何使用Spring配置的文章,但我试图通过仅使用Java DSL来实现这一点。
这是我现在有,请可能有人点我就如何操纵正确的方向CXF超时的使用Java DSL
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");