从CXF端点并行使用

问题描述 投票:0回答:1

我遇到了从CXF端点并行消耗的问题。如果我将50个或更多并发请求发送到Web服务(在Camel路由中作为CXF端点发布),则只有25个线程从中消耗并开始路由处理。无论Web服务器上的SYNC / ASYNC请求处理如何,都会出现这种情况(默认情况下使用Jetty)。我试图增加Jetty池的大小 - 也没有效果。所以问题是:在哪里定义了来自CXF端点的并行消耗限制。

我们在JBossFuse 6.2.1下有Apache Camel 2.15.1,Apache CXF 3.0.4

这是Jetty和CXF端点配置:

<!-- Jetty -->

<bean id="server" class="org.eclipse.jetty.server.Server"/>

<httpj:engine-factory bus="cxf">
    <httpj:identifiedThreadingParameters id="sampleThreading1">
        <httpj:threadingParameters minThreads="100" maxThreads="200"/>
    </httpj:identifiedThreadingParameters>

    <httpj:engine port="9001">
        <httpj:threadingParametersRef id="sampleThreading1"/>
        <httpj:connector>
            <bean class="org.eclipse.jetty.server.bio.SocketConnector">
                <property name = "port" value="9001" />
            </bean>
        </httpj:connector>
        <httpj:handlers>
            <bean class="org.eclipse.jetty.server.handler.DefaultHandler"/>
        </httpj:handlers>
        <httpj:sessionSupport>true</httpj:sessionSupport>
    </httpj:engine>
</httpj:engine-factory>

<!-- CXF -->

<cxf:cxfEndpoint
        id="abcOutboundService"
        address="http://localhost:9001/cxf/ABCOutbound"
        xmlns:s="http://www.smpbank.ru/ABC"
        serviceName="s:ABCOutboundRq"
        endpointName="s:ASBOABCOutPort"
        wsdlURL="model/ASBOABCOut/ABCOutboundRq.wsdl">

    <cxf:properties>
        <entry key="dataFormat" value="PAYLOAD"/>
    </cxf:properties>
</cxf:cxfEndpoint>

和路线定义:

<camelContext id="AdpABCOutReq_WS" xmlns="http://camel.apache.org/schema/blueprint">
    <route id="adpabcout.ws" startupOrder="10" errorHandlerRef="wsProcessingErrorHandler">
        <from uri="cxf:bean:abcOutboundService"/>
        <log message="REQUEST CONSUMED BY Thread:[${threadName}] FROM WEB SERVICE: Headers:[${headers}]\nBody:[${body}]"/>

...

    </route>
</camelContext>
apache-camel cxf jbossfuse
1个回答
0
投票

您可能遇到CXF工作队列限制。您可以尝试设置工作队列

 <cxfcore:workqueue name="default" 
    highWaterMark="${work.queue.high.limit}" 
    lowWaterMark="${work.queue.low.limit}" 
    initialSize="${work.queue.initial.size}" 
    dequeueTimeout="${work.queue.timeout}" 
    queueSize="${work.queue.size}"/>

默认值为highWaterMark=25lowWaterMark=5initialSize=0queueSize=256queueTimeout=2mins

© www.soinside.com 2019 - 2024. All rights reserved.