0 Replies Latest reply on Nov 15, 2012 12:41 PM by eric.bender

    Performance Issue when Sending Messages from Jetty to CXF

    eric.bender

      I have a bundle deployed in servicemix that has two routes within it.  1 is a jetty route that sits on port 9191 and receives soap messages and routes them to a CXF consumer in a different route, which then processes the messages and sends to an external system and gets responses.  The second route is the CXF consumer (on port 9192) which checks for errors and sends to a CXF producer linked to the external web service.

       

      When we do a load test with 10 transactions per second, looking at the logs, I see that the jetty endpoint receives the messages 10 per second, but the CXF endpoint lags behind.  Granted, the calls the CXF consumer/producer are making to an external system can take up to 2 seconds, but I have increased the worker threads within CXF and it seems to have no effect on the throughput of the CXF route.  I have set the following so I am not sure why the CXF consumer would not be getting more messages from the jetty endpoint. 

       

      If I have the incoming SOAP messages go directly to the CXF endpoint instead of the jetty listener, it processes them all and overall performs about 50% faster.  What could be causing this performance hit between jetty and CXF?

       

          <bean id="cxf.default.workqueue" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
               <property name="name" value="default"></property>
               <property name="lowWaterMark" value="20"></property>
              <property name="highWaterMark" value="50"></property>
          </bean>
      

       

      The jetty listener that first receives the messages from the outside world

       

                 <from uri="jetty:http://0.0.0.0:9191/?matchOnUriPrefix=true"/>
                     <log message="Incoming gateway request" loggingLevel="INFO"></log>
      // This just evaluates the incoming URL and sets the dynamicEndpoint to route to that endpoint (in this case it will just be to the CXF consumer deployed in servicemix within the same camel context displayed below)
                  <to uri="gatewayProcessor"></to>  
                   <choice>
                        <when>
                             <simple>${headers.dynamicEndpoint} == null</simple>
                             <log message="Dynamic Endpoint not set, invalid url path" loggingLevel="ERROR"></log>
                         </when>
                        <otherwise>
                            <recipientList delimiter=",">
                                <header>dynamicEndpoint</header>
                            </recipientList>
                        </otherwise>
                   </choice>
             
                </route>
      

       

      The CXF consumer / producer route and beans for both

       

                <route id="JavelinInitiateService">
                        <from uri="cxf:bean:initiateCXFConsumer"></from>
                        <log message="Incoming request for JavelinInitiateService" loggingLevel="INFO"></log>
                     <to uri="cxf:bean:initiateCXFProducer"></to>
               </route>
      
          <cxf:cxfEndpoint
                  id="initiateCXFConsumer"
                  address="http://0.0.0.0:9192/Javelin/InitiateService"
                  wsdlURL="wsdl/initiate.wsdl"
                  serviceClass="com.ihg.webservice.JavelinInitiateService">
                  <cxf:properties>
                      <entry key="dataFormat" value="MESSAGE"></entry>
                      <entry key="receiveTimeout" value="60000"></entry>
                      <entry key="connectionTimeout" value="60000"></entry>
                     <entry key="schema-validation-enabled" value="true"></entry>
                 </cxf:properties>
          </cxf:cxfEndpoint>
      
           <cxf:cxfEndpoint
                id="initiateCXFProducer"
                address="http://qa-mdmjavelin.hiw.com/IHG/services/JavelinInitiateService"  // Link to external web service
                serviceClass="com.ihg.webservice.JavelinInitiateService"
                serviceName="s:JavelinInitiateServiceService"
                endpointName="s:JavelinInitiateService"
                xmlns:s="http://webservice.ihg.com">
                <cxf:properties>
                     <entry key="dataFormat" value="MESSAGE"></entry>
                    <entry key="receiveTimeout" value="60000"></entry>
                     <entry key="connectionTimeout" value="60000"></entry>
                     <entry key="schema-validation-enabled" value="true"></entry>
                </cxf:properties>          
           </cxf:cxfEndpoint>
      

       

      So what could be causing the delay in jetty sending messages to the CXF listener in this case? 

       

      To sum up the message path:

      External System sends SOAP request ==> Jetty Route (port 9191) =lag=> CXF Consumer (9192) ==> CXF Producer ==> External Web Service.