org.zodiac.autoconfigure.hystrix.ReactivePlatformHystrixAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.hystrix;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.zodiac.autoconfigure.hystrix.condition.ConditionalOnFeignHystrixEnabled;
@SpringBootConfiguration
@ConditionalOnWebApplication(type = Type.REACTIVE)
@ConditionalOnFeignHystrixEnabled
@ConditionalOnClass(value= {com.netflix.hystrix.Hystrix.class, feign.Feign.class, feign.hystrix.HystrixFeign.class, org.zodiac.hystrix.core.PlatformHystrixConcurrencyStrategy.class})
public class ReactivePlatformHystrixAutoConfiguration {
public ReactivePlatformHystrixAutoConfiguration() {
}
@Bean
@ConditionalOnMissingBean
protected org.zodiac.hystrix.core.config.ReactivePlatformHystrixConfigurer reactivePlatformHystrixConfigurer() {
return new org.zodiac.hystrix.core.config.ReactivePlatformHystrixConfigurer();
}
@Bean
@Order(value = 0)
@ConditionalOnMissingBean
protected feign.RequestInterceptor requestInterceptor(org.zodiac.hystrix.core.config.ReactivePlatformHystrixConfigurer reactivePlatformHystrixConfigurer) {
return reactivePlatformHystrixConfigurer.requestInterceptor();
}
}