spring cloud hystrix.

This commit is contained in:
Administrator 2018-12-03 17:00:03 +08:00
parent 27fdf9ba1e
commit e6ce49819c

View File

@ -17,32 +17,32 @@
package org.dromara.hmily.springcloud.feign;
import feign.Feign;
import feign.InvocationHandlerFactory;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
/**
* HmilyRestTemplateConfiguration.
*
* @author xiaoyu
*/
@Configuration
public class HmilyRestTemplateConfiguration {
/**
* build feign.
* Hmily rest template interceptor request interceptor.
*
* @return Feign.Builder
* @return the request interceptor
*/
@Bean
@Scope("prototype")
public Feign.Builder feignBuilder() {
return Feign.builder().requestInterceptor(new HmilyRestTemplateInterceptor()).invocationHandlerFactory(invocationHandlerFactory());
public RequestInterceptor hmilyRestTemplateInterceptor() {
return new HmilyRestTemplateInterceptor();
}
/**
* build InvocationHandlerFactory.
*
* @return InvocationHandlerFactory
*/
@Bean