package com.ycl.config.feign; import feign.codec.Decoder; import org.springframework.beans.factory.ObjectFactory; import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.cloud.openfeign.support.SpringDecoder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class FeignGlobalConfiguration { @Bean public Decoder feignDecoder(){ MessageConverter converter = new MessageConverter(); ObjectFactory objectFactory = () -> new HttpMessageConverters(converter); return new SpringDecoder(objectFactory); } }