0
votes

I ran into a problem of parallel consuming from CXF-endpoint. If I send for example 50 or more concurrent request into web service, published as CXF-endpoint in Camel route, only 25 threads consume from it and start route processing. This situation occurs regardless of SYNC/ASYNC request processing on the web-server (Jetty is used by default). I tried to increase Jetty pool size - with no effect also. So the question is: where defined the limit of parallel consuming from CXF-endpoint.

We have Apache Camel 2.15.1, Apache CXF 3.0.4 under JBossFuse 6.2.1

Here is Jetty and CXF-endpoint configuration:

<!-- 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>

And the route definition:

<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>
1
I guess there is only way to increase CXF consuming parallelism is to setup (or override) route/context thread pool like this: <threadPoolProfile id="tp" defaultProfile="true" poolSize="50" maxPoolSize="100"/> - Andrey Smirnov

1 Answers

0
votes

You may be running into CXF workqueue limit. You can try setting up the workqueue by

 <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}"/>

The default values are highWaterMark=25, lowWaterMark=5, initialSize=0,queueSize=256 and queueTimeout=2mins