通过Zuul上传文件,禁用Zuul的Filters

microservice-file-upload

spring:
        application:
            name: microservice-file-upload
        http:
            multipart:
                max-file-size: 2000Mb    (默认1M)
                max-request-size: 2500Mb (默认10M)
				
https://www.cnblogs.com/gqymy/p/11195794.html

https://blog.csdn.net/starskyboy/article/details/83217251

spring.application.http.multipart.max-file-size=2000Mb
spring.application.http.multipart.max-request-size=2000Mb

/**
 * Max file size. Values can use the suffixes "MB" or "KB" to indicate megabytes or
 * kilobytes respectively.
 */
private String maxFileSize = "1MB";

localhost:8050/index.html

https://blog.csdn.net/shenzhen_zsw/article/details/81009235

zuul有一个端点是/zuul/*

https://cloud.spring.io/spring-cloud-netflix/reference/html/#_strangulation_patterns_and_local_forwards

Uploading Files through Zuul

我们上传都是用的SpringMVC的,SpringMVC默认是/**,所以它使用的是Spring DispatcherServlet,当Zuul在你的classpath

下面呢,他就会绕过这个东西

上传大文件得将超时时间设置长一些,否则会报超时异常。以下几行超时设置来自

https://cloud.spring.io/spring-cloud-netflix/reference/html/#_uploading_files_through_zuul

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000
ribbon:
  ConnectTimeout: 3000
  ReadTimeout: 60000

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000
ribbon.ConnectTimeout=3000
ribbon.ReadTimeout=6000

经过zuul的请求,他都会用hystrix进行包裹,所以我需要配一下hystrix的超时时间,然后zuul还是用了ribbon做

负载均衡,所以我也要设置一下ribbon的ConnectTimeout,和ReadTimeout

 

上一篇:linux的常用命令--ifconfig命令【持续补充ing】


下一篇:ifconfig