[英]file upload zuul proxy request size issue
i have a probleme with zuul proxy, it's about the size of the request, i always getting 500 error Connection has being closed before response.我有 zuul 代理的问题,它与请求的大小有关,我总是收到 500 错误连接已在响应之前关闭。
controller code :控制器代码:
@RestController
@RequestMapping("/file")
public class FileController {
@PostMapping("/upload")
public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
System.out.println("File Name : " + file.getOriginalFilename(),
"File Size : " + file.getSize() + "bytes");
return ResponseEntity.ok(file.getName() + " uploaded");
}
}
Any idea?任何的想法?
Your problem here is with the ribbon socket size.您的问题在于色带插座尺寸。 Try to add this properties to your getway properties file -- the one where you enabled zuul proxy -- :
尝试将此属性添加到您的 getway 属性文件 - 您启用 zuul 代理的文件 - :
ribbon.eager-load.enabled=true
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.execution.isolation.strategy=THREAD
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=3999996
ribbon.ConnectTimeout=999999
ribbon.ReadTimeout=999999
ribbon.SocketTimeout=999999
zuul.host.socket-timeout-millis=999999
zuul.host.connect-timeout-millis=999999
zuul.sensitiveHeaders=Cookie,Set-Cookie
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.