org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory Java Examples

The following examples show how to use org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringRetryAutoConfiguration.java    From spring-cloud-circuitbreaker with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(CircuitBreakerFactory.class)
public CircuitBreakerFactory springRetryCircuitBreakerFactory() {
	SpringRetryCircuitBreakerFactory factory = new SpringRetryCircuitBreakerFactory();
	customizers.forEach(customizer -> customizer.customize(factory));
	return factory;
}
 
Example #2
Source File: Resilience4JAutoConfiguration.java    From spring-cloud-circuitbreaker with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(CircuitBreakerFactory.class)
public Resilience4JCircuitBreakerFactory resilience4jCircuitBreakerFactory() {
	Resilience4JCircuitBreakerFactory factory = new Resilience4JCircuitBreakerFactory();
	customizers.forEach(customizer -> customizer.customize(factory));
	return factory;
}
 
Example #3
Source File: BottlingServiceUpdater.java    From brewery with Apache License 2.0 5 votes vote down vote up
public BottlingServiceUpdater(BrewProperties brewProperties,
        Tracer tracer,
        PresentingServiceClient presentingServiceClient,
        BottlingService bottlingService,
        RestTemplate restTemplate, EventGateway eventGateway, CircuitBreakerFactory circuitBreakerFactory) {
    this.brewProperties = brewProperties;
    this.tracer = tracer;
    this.presentingServiceClient = presentingServiceClient;
    this.bottlingService = bottlingService;
    this.restTemplate = restTemplate;
    this.eventGateway = eventGateway;
    this.circuitBreakerFactory = circuitBreakerFactory;
}
 
Example #4
Source File: BrewConfiguration.java    From brewery with Apache License 2.0 5 votes vote down vote up
@Bean
BottlingServiceUpdater bottlingServiceUpdater(Tracer trace, PresentingServiceClient presentingServiceClient,
                                              BottlingService bottlingService,
                                              @LoadBalanced RestTemplate restTemplate,
                                              EventGateway eventGateway, CircuitBreakerFactory circuitBreakerFactory) {
    return new BottlingServiceUpdater(brewProperties(), trace, presentingServiceClient,
            bottlingService, restTemplate, eventGateway, circuitBreakerFactory);
}
 
Example #5
Source File: BottlerService.java    From brewery with Apache License 2.0 5 votes vote down vote up
public BottlerService(BottlingWorker bottlingWorker, PresentingClient presentingClient,
                      RestTemplate restTemplate, Tracer tracer, CircuitBreakerFactory factory) {
    this.bottlingWorker = bottlingWorker;
    this.presentingClient = presentingClient;
    this.restTemplate = restTemplate;
    this.tracer = tracer;
    this.factory = factory;
}
 
Example #6
Source File: DemoController.java    From spring-cloud-circuitbreaker-demo with Apache License 2.0 4 votes vote down vote up
public DemoController(CircuitBreakerFactory circuitBreakerFactory, HttpBinService httpBinService) {
	this.circuitBreakerFactory = circuitBreakerFactory;
	this.httpBin = httpBinService;
}
 
Example #7
Source File: DemoController.java    From spring-cloud-circuitbreaker-demo with Apache License 2.0 4 votes vote down vote up
public DemoController(CircuitBreakerFactory circuitBreakerFactory, HttpBinService httpBinService) {
	this.circuitBreakerFactory = circuitBreakerFactory;
	this.httpBin = httpBinService;
}
 
Example #8
Source File: DemoController.java    From spring-cloud-circuitbreaker-demo with Apache License 2.0 4 votes vote down vote up
public DemoController(CircuitBreakerFactory circuitBreakerFactory, HttpBinService httpBinService) {
	this.circuitBreakerFactory = circuitBreakerFactory;
	this.httpBin = httpBinService;
}
 
Example #9
Source File: SpringRetryCircuitBreakerIntegrationTest.java    From spring-cloud-circuitbreaker with Apache License 2.0 4 votes vote down vote up
DemoControllerService(TestRestTemplate rest,
		CircuitBreakerFactory cbFactory) {
	this.rest = spy(rest);
	this.cbFactory = cbFactory;
	this.circuitBreakerSlow = cbFactory.create("slow");
}
 
Example #10
Source File: Resilience4JCircuitBreakerIntegrationTest.java    From spring-cloud-circuitbreaker with Apache License 2.0 4 votes vote down vote up
DemoControllerService(TestRestTemplate rest,
		CircuitBreakerFactory cbFactory) {
	this.rest = rest;
	this.cbFactory = cbFactory;
	this.circuitBreakerSlow = cbFactory.create("slow");
}
 
Example #11
Source File: SentinelCircuitBreakerAutoConfiguration.java    From spring-cloud-alibaba with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(CircuitBreakerFactory.class)
public CircuitBreakerFactory sentinelCircuitBreakerFactory() {
	return new SentinelCircuitBreakerFactory();
}
 
Example #12
Source File: SentinelCircuitBreakerIntegrationTest.java    From spring-cloud-alibaba with Apache License 2.0 4 votes vote down vote up
DemoControllerService(TestRestTemplate rest,
		CircuitBreakerFactory cbFactory) {
	this.rest = rest;
	this.cbFactory = cbFactory;
}
 
Example #13
Source File: BottlingConfiguration.java    From brewery with Apache License 2.0 4 votes vote down vote up
@Bean
BottlerService bottlingService(BottlingWorker bottlingWorker,
                               PresentingClient presentingClient,
                               Tracer tracer, CircuitBreakerFactory circuitBreakerFactory, @LoadBalanced RestTemplate restTemplate) {
    return new BottlerService(bottlingWorker, presentingClient, restTemplate, tracer, circuitBreakerFactory);
}
 
Example #14
Source File: Bottler.java    From brewery with Apache License 2.0 4 votes vote down vote up
@Autowired
public Bottler(BottlerService bottlerService, CircuitBreakerFactory circuitBreakerFactory) {
    this.bottlerService = bottlerService;
    this.circuitBreakerFactory = circuitBreakerFactory;
}