簡體   English   中英

具有大數據量的呼叫發布休息API時引發錯誤

[英]Error thrown when call post rest api with big data size

我有個問題。 當我用大數據(體內大約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

我正在使用wildfly Web服務器並設置maxPostSize = 250961630,但無法正常工作。

有人能幫助我嗎?

問題解決了。 在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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM