feign接口参数使用@RequestPart 而非@RequestParam, 同时需要指定consumes,比如这样:
@PostMapping(value="/upload",consumes= MediaType.MULTIPART_FORM_DATA_VALUE) Result<FileStorage>upload(@RequestPart(value="file") MultipartFile file);
这是hystrix导致,关闭feign熔断,或者延长熔断的超时时间,我简单粗暴的直接关了
配置了hystrix还不行,或者延长ribbon的超时时间,参考了Feign超时问题的办法,简单来说就是feign经过了ribbonn和hystrix两级调用,而且都有一个默认的超时时间,延长超时时间就好了
spring:servlet:context-path: /farmapplication:name: farmprofiles:active: devmain:allow-bean-definition-overriding:trueeureka:client:service-url:defaultZone: http://127.0.0.1:7001/eurekainstance:prefer-ip-address:true#关闭feign熔断feign:hystrix:enabled:false#开启熔断,关闭熔断超时或延长调用超时时间#hystrix:# command:# default:# execution:# timeout:# enabled: false# isolation:# thread:# timeoutInMilliseconds: 30000#延长ribbon超时时间ribbon:ReadTimeout:30000ConnectTimeout:30000