Announcement Announcement Module
Collapse
No announcement yet.
Application Hangs when a large amount of data is returned Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:
    Code:
            Source requestSource = new ResourceSource(request);
            StringResult result = new StringResult();
            getWebServiceTemplate().sendSourceAndReceiveToResult(requestSource, new SoapActionCallback("http://app.publicaster.com/MailingList_Get_EntireList"), result);    	
            System.out.println("completed...");
    What I am seeing in the logs via log4j.logger.org.springframework.ws=DEBUG
    Code:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    	<SOAP-ENV:Header/>
    	<SOAP-ENV:Body>
    		<ns2:MailingList_Get_EntireList xmlns:ns2="http://app.publicaster.com/">
    			<ns2:AccountID>123</ns2:AccountID>
    			<ns2:ListID>12674</ns2:ListID>
    			<ns2:LastID>12674</ns2:LastID>
    			<ns2:pageSize>2000</ns2:pageSize>
    		</ns2:MailingList_Get_EntireList>
    	</SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    	<soap:Body>
    		<MailingList_Get_EntireListResponse xmlns="http://app.publicaster.com/">
    			<MailingList_Get_EntireListResult>
    				<AccountID>123</AccountID>
    				<ListID>12674</ListID>
    				<LastID>295</LastID>
    				<TotalListSize>1150</TotalListSize>
    				<ListDetail>
    					<NewDataSet>
    					  <Table>
    						<Email>[email protected]</Email>
    						<Full_Name>John Smith</Full_Name>
    						<Company>Test Company - Stage</Company>
    						<Address1>9382 Lane</Address1>
    						<City>Burlington</City>
    						<State>IL</State>
    						<Zip>60109</Zip>
    						<Phone>111-111-1111</Phone>
    						<ID>4304470</ID>
    					  </Table>
    					  <Table>
    						<Email>[email protected]</Email>
    						<Full_Name>Keith Walter</Full_Name>
    						<Company>Test Company - Stage</Company>
    						<Address1>9382 Street</Address1>
    						<City>Burlington</City>
    						<State>IL</State>
    						<Zip>60109</Zip>
    						<Phone>111-111-1111</Phone>
    						<ID>4304471</ID>
    					  </Table>
    						...... 1000+ more pieces of data 
    					</NewDataSet>
    				</ListDetail>
    			</MailingList_Get_EntireListResult>
    		</MailingList_Get_EntireListResponse>
    	</soap:Body>
    </soap:Envelope>

    Pasted below is a stack trace of where I think the app is hanging.
    Code:
    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,

    Keith

  • #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.

    Comment


    • #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 (org.springframework.ws.client.MessageTracing) to make it easier to disable/enable.

      Comment


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

        Keith

        Comment

        Working...
        X