Announcement Announcement Module
No announcement yet.
Application Hangs when a large amount of data is returned Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application Hangs when a large amount of data is returned

    Our application is hanging when attempting to use a third party web service. This doesn't happen when the amount of data returned from the service is small, only when 1000 or pieces of data are returned.

    Code that is run:
            Source requestSource = new ResourceSource(request);
            StringResult result = new StringResult();
            getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, new SoapActionCallback(""), result);    	
    What I am seeing in the logs via
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="">
    		<ns2:MailingList_Get_EntireList xmlns:ns2="">
    <soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
    		<MailingList_Get_EntireListResponse xmlns="">
    						<Email>[email protected]</Email>
    						<Full_Name>John Smith</Full_Name>
    						<Company>Test Company - Stage</Company>
    						<Address1>9382 Lane</Address1>
    						<Email>[email protected]</Email>
    						<Full_Name>Keith Walter</Full_Name>
    						<Company>Test Company - Stage</Company>
    						<Address1>9382 Street</Address1>
    						...... 1000+ more pieces of data 

    Pasted below is a stack trace of where I think the app is hanging.
    Message1_1Impl.getSOAPPart() line: 80 <-- hangs here
    Saaj13Implementation.getEnvelope(SOAPMessage) line: 168
    SaajSoapMessage.getEnvelope() line: 82
    SaajSoapMessage(AbstractSoapMessage).getSoapBody() line: 36
    SaajSoapMessage(AbstractSoapMessage).getPayloadSource() line: 46
    WebServiceTemplate$SourceExtractorMessageExtractor.extractData(WebServiceMessage) line: 581
    WebServiceTemplate.sendAndReceive(String, WebServiceMessageCallback, WebServiceMessageExtractor) line: 408
    WebServiceTemplate.doSendAndReceive(String, Transformer, Source, WebServiceMessageCallback, SourceExtractor) line: 350
    WebServiceTemplate.sendSourceAndReceiveToResult(String, Source, WebServiceMessageCallback, Result) line: 296
    WebServiceTemplate.sendSourceAndReceiveToResult(Source, WebServiceMessageCallback, Result) line: 287
    EchoClient.echo() line: 33 <-- where our code passes things off to Spring
    The System.out.println("completed..."); never gets hit.

    Any thoughts on this one?

    Thanks in advance,


  • #2
    Well it looks like you are using SAAJ to build the SOAP messages. With large messages, SAAJ can be inefficient. You might consider using AXIOM. Look here for more information. Beware that you don't gain the benefit unless you turn turn payloadCaching to false. This means it reads each piece of the message only once. So you cannot use PayloadLoggingInterceptor and the like. At least that is what I have read. Someone correct me if I am wrong.


    • #3
      You are right . Also, disable the debug logging, because that dumps the message as well.

      In 1.0.2, there will be a new logger category for message tracing ( to make it easier to disable/enable.


      • #4
        Thanks for your help, it works great now.