mirror of
https://gitee.com/dromara/hmily.git
synced 2024-12-03 03:38:33 +08:00
spring cloud hystrix.
This commit is contained in:
parent
27fdf9ba1e
commit
e6ce49819c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user