简体   繁体   English

具有大数据量的呼叫发布休息API时引发错误

[英]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.

相关问题 当响应大小很大时,来自Android的HTTP POST不返回数据 - HTTP POST from Android not return data when response size big 在 Angular 4 中将数据发送到 JAVA post REST API 时出现 CORS 错误 - Getting CORS error when sending data to JAVA post REST API in Angular 4 将POST请求发送到REST API时出现415错误 - 415 error when sending POST request to REST API 在REST API中发布帖子时出现不受支持的媒体类型错误 - Unsupported Media Type error when making a post into a REST API 调用REST调用时抛出CXF异常 - CXF Exception thrown when calling REST call is made JSON 用于调用 REST API 的 POST 请求的输入 - JSON Input for POST request to call REST API REST API调用和POST请求(Java) - Rest api call and POST request (java) 我有 Spring Boot REST API 应用程序,当多个用户调用此 API 时,它具有 POST 调用我面临数据不一致 - I am having Spring Boot REST API appilcation which has POST call when multiple users are calling this API I am facing data inconsistency 当有效负载超过特定大小时,Java REST API调用失败,异常“异步操作超时” - Java REST API call fails with exception “Async operation timed out” when payload exceeds certain size 如何调用 Rest API 并使用该 API 中的数据? - How to call Rest API and use the data in that API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM