Я пытаюсь проксировать составной запрос через feign.
@PostMapping(value = "{pathUri1}/{pathUri2}",consumes = MediaType.MULTIPART_FORM_DATA_VALUE,produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity<BaseResponse<?>> uploadFileCall(@PathVariable(value = "pathUri1") String pathUri1, @PathVariable(value = "pathUri2") String pathUri2, @RequestPart(name = "file") MultipartFile file, @RequestParam Map<Object,Object> requestParam, @RequestHeader HttpHeaders httpHeaders);
это сервисный звонок.
@Configuration
class MultipartSupportConfig {
@Autowired
ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
@Primary
@Scope("prototype")
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
}
добавлена конфигурация кодировщика для multipart/form-data .
Я следил за этим https://github.com/OpenFeign/feign-form
Но я получаю hystrixRunTimeException
, что вызвано ошибкой java.lang.NoClassDefFoundError: feign/Request$Body.