Remove resilience4j
This commit is contained in:
@@ -36,7 +36,6 @@
|
|||||||
<gson.version>2.8.9</gson.version>
|
<gson.version>2.8.9</gson.version>
|
||||||
<netty-tcnative.version>2.0.50.Final</netty-tcnative.version>
|
<netty-tcnative.version>2.0.50.Final</netty-tcnative.version>
|
||||||
<spring-cloud.version>2.2.9.RELEASE</spring-cloud.version>
|
<spring-cloud.version>2.2.9.RELEASE</spring-cloud.version>
|
||||||
<resilience4j.version>1.7.1</resilience4j.version>
|
|
||||||
<snakeyaml.version>1.30</snakeyaml.version>
|
<snakeyaml.version>1.30</snakeyaml.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -65,11 +64,6 @@
|
|||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency> -->
|
</dependency> -->
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
|
|
||||||
<version>1.0.6.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-context</artifactId>
|
<artifactId>spring-cloud-context</artifactId>
|
||||||
@@ -80,26 +74,6 @@
|
|||||||
<artifactId>spring-cloud-commons</artifactId>
|
<artifactId>spring-cloud-commons</artifactId>
|
||||||
<version>${spring-cloud.version}</version>
|
<version>${spring-cloud.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-spring-boot2</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-circuitbreaker</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-timelimiter</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-reactor</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
|
|||||||
@@ -155,27 +155,6 @@
|
|||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-spring-boot2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-circuitbreaker</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-timelimiter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-reactor</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
package we.config;
|
|
||||||
|
|
||||||
import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig;
|
|
||||||
import io.github.resilience4j.timelimiter.TimeLimiterConfig;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.cloud.circuitbreaker.resilience4j.ReactiveResilience4JCircuitBreakerFactory;
|
|
||||||
import org.springframework.cloud.circuitbreaker.resilience4j.Resilience4JConfigBuilder;
|
|
||||||
import org.springframework.cloud.client.circuitbreaker.Customizer;
|
|
||||||
import org.springframework.cloud.client.loadbalancer.reactive.ReactorLoadBalancerExchangeFilterFunction;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
import we.Fizz;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.Duration;
|
|
||||||
|
|
||||||
//@Configuration
|
|
||||||
public class FizzWebClientConfig {
|
|
||||||
|
|
||||||
/*public static final String FIZZ_LOAD_BALANCED_WEB_CLIENT = "fizzLoadBalancedWebClient";
|
|
||||||
|
|
||||||
@Bean(FIZZ_LOAD_BALANCED_WEB_CLIENT)
|
|
||||||
public WebClient LoadBalancedWebClient(@Qualifier(ProxyWebClientConfig.proxyWebClient) WebClient sourceWebClient,
|
|
||||||
ReactorLoadBalancerExchangeFilterFunction reactorLoadBalancerExchangeFilterFunction) {
|
|
||||||
|
|
||||||
return sourceWebClient.mutate().filter(reactorLoadBalancerExchangeFilterFunction).build();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// disable the Resilience4J auto-configuration spring.cloud.circuitbreaker.resilience4j.enabled = false
|
|
||||||
|
|
||||||
/*@Bean
|
|
||||||
public Customizer<ReactiveResilience4JCircuitBreakerFactory> defaultCustomizer() {
|
|
||||||
return factory -> factory.configureDefault(
|
|
||||||
id -> new Resilience4JConfigBuilder(id)
|
|
||||||
.circuitBreakerConfig(CircuitBreakerConfig.ofDefaults())
|
|
||||||
.timeLimiterConfig(TimeLimiterConfig.custom().timeoutDuration(Duration.ofSeconds(4)).build())
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*@Bean
|
|
||||||
public Customizer<ReactiveResilience4JCircuitBreakerFactory> slowCustomizer() {
|
|
||||||
return factory -> {
|
|
||||||
factory.configure(
|
|
||||||
builder -> builder
|
|
||||||
.circuitBreakerConfig(CircuitBreakerConfig.ofDefaults())
|
|
||||||
.timeLimiterConfig(TimeLimiterConfig.custom().timeoutDuration(Duration.ofSeconds(2)).build()),
|
|
||||||
"slow", "slowflux"
|
|
||||||
);
|
|
||||||
factory.addCircuitBreakerCustomizer(
|
|
||||||
Customizer.once(
|
|
||||||
circuitBreaker -> circuitBreaker.getEventPublisher()
|
|
||||||
.onError(null) // normalFluxErrorConsumer
|
|
||||||
.onSuccess(null), // normalFluxSuccessConsumer
|
|
||||||
circuitBreaker -> circuitBreaker.getName()
|
|
||||||
),
|
|
||||||
"normalflux"
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*@Resource
|
|
||||||
private ReactiveResilience4JCircuitBreakerFactory reactiveResilience4JCircuitBreakerFactory;
|
|
||||||
|
|
||||||
public void x() {
|
|
||||||
WebClient webClient = (WebClient) Fizz.context.getBean(ProxyWebClientConfig.proxyWebClient);
|
|
||||||
webClient.get().uri("/slow").retrieve().bodyToMono(String.class)
|
|
||||||
.transform(
|
|
||||||
stringMono -> reactiveResilience4JCircuitBreakerFactory.create("slow")
|
|
||||||
.run(stringMono, throwable -> Mono.just("fallback"))
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
27
pom.xml
27
pom.xml
@@ -24,7 +24,6 @@
|
|||||||
<commons-pool2.version>2.11.1</commons-pool2.version>
|
<commons-pool2.version>2.11.1</commons-pool2.version>
|
||||||
<netty-tcnative.version>2.0.50.Final</netty-tcnative.version>
|
<netty-tcnative.version>2.0.50.Final</netty-tcnative.version>
|
||||||
<spring-cloud.version>2.2.9.RELEASE</spring-cloud.version>
|
<spring-cloud.version>2.2.9.RELEASE</spring-cloud.version>
|
||||||
<resilience4j.version>1.7.1</resilience4j.version>
|
|
||||||
<snakeyaml.version>1.30</snakeyaml.version>
|
<snakeyaml.version>1.30</snakeyaml.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -238,32 +237,6 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
|
|
||||||
<version>1.0.6.RELEASE</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-spring-boot2</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-circuitbreaker</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-timelimiter</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.resilience4j</groupId>
|
|
||||||
<artifactId>resilience4j-reactor</artifactId>
|
|
||||||
<version>${resilience4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-context</artifactId>
|
<artifactId>spring-cloud-context</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user