Updates for optional hystrix deps
This commit is contained in:
3
pom.xml
3
pom.xml
@@ -22,6 +22,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<reactor.version>3.0.4.RELEASE</reactor.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -69,10 +70,12 @@
|
||||
<artifactId>spring-cloud-starter-hystrix</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- TODO: should be part of spring-cloud-starter-hystrix -->
|
||||
<dependency>
|
||||
<groupId>io.reactivex</groupId>
|
||||
<artifactId>rxjava-reactive-streams</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -41,7 +41,10 @@ import org.springframework.cloud.gateway.handler.predicate.UrlRoutePredicate;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.netflix.hystrix.HystrixObservableCommand;
|
||||
|
||||
import reactor.ipc.netty.http.client.HttpClient;
|
||||
import rx.RxReactiveStreams;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
@@ -163,6 +166,7 @@ public class GatewayAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean(name = "HystrixRouteFilter")
|
||||
@ConditionalOnClass({HystrixObservableCommand.class, RxReactiveStreams.class})
|
||||
public HystrixRouteFilter hystrixRouteFilter() {
|
||||
return new HystrixRouteFilter();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user