spring - How to increase the springMVC json response time -
in spring controller has long running process , returns output json, after time controller returns empty json while still processing in server. how handle in spring
while fetching records database or getting records spring web services json or xml format connectiontimeout (500 i/o error) or readtimeout error occurs.
increase service elapsed time / connection timeout , read timeout in spring mvc using httpcomponentsmessagesender
require jar spring-ws-2.1.3.release-all.jar add in web-inf/lib
or add below maven dependency in pom.xml
<!-- https://mvnrepository.com/artifact/org.springframework.ws/spring-ws --> <dependency> <groupid>org.springframework.ws</groupid> <artifactid>spring-ws</artifactid> <version>2.1.3.release</version> </dependency>
add below code in mvc-dispatcher-servlet.xml
<bean class="org.springframework.ws.transport.http.httpcomponentsmessagesender"> <property name="connectiontimeout" value="600000" /> <property name="readtimeout" value="600000" /> </bean>
note: 600000 means 10 minutes. if want increase timeout
multiply
1000 milliseconds * 60 seconds * 10 minutes = 600000
1000 milliseconds * 60 seconds * 30 minutes = 1800000
Comments
Post a Comment