[英]Error thrown when call post rest api with big data size
I have a problem. 我有个问题。 When I call a post rest api with big data (about 35 megabyte in body) this exception is thrown:
当我用大数据(体内大约35兆字节)调用post rest api时,抛出此异常:
org.springframework.web.client.ResourceAccessException:
I/O error on POST request for "x": Software caused connection abort: recv failed;
nested exception is java.net.SocketException:
Software caused connection abort: recv failed
I am using wildfly web server and set maxPostSize=250961630, but it is not working. 我正在使用wildfly Web服务器并设置maxPostSize = 250961630,但无法正常工作。
Can someone help me, please? 有人能帮助我吗?
The problem solved. 问题解决了。 In Spring boot,you must define multipartConfigElement bean and set value on setMaxFileSize and setMaxRequestSize properties.The code is:
在Spring Boot中,必须定义multipartConfigElement bean并在setMaxFileSize和setMaxRequestSize属性上设置值。代码为:
@Bean
public MultipartConfigElement multipartConfigElement()
{
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("1000MB");
factory.setMaxRequestSize("1000MB");
return factory.createMultipartConfig();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.