spring cloud hystrix.

This commit is contained in:
Administrator 2018-12-03 17:01:29 +08:00
parent 9a9d4bfa15
commit 8b4baabcb7

View File

@ -18,22 +18,21 @@
package org.dromara.raincat.springcloud.feign; package org.dromara.raincat.springcloud.feign;
import feign.Feign; import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
/** /**
* RestTemplateConfiguration. * RestTemplateConfiguration.
*
* @author xiaoyu * @author xiaoyu
*/ */
@Configuration @Configuration
public class RestTemplateConfiguration { public class RestTemplateConfiguration {
@Bean @Bean
@Scope("prototype") public RequestInterceptor requestInterceptor() {
public Feign.Builder feignBuilder() { return new RestTemplateInterceptor();
return Feign.builder().requestInterceptor(new RestTemplateInterceptor());
} }
} }