forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue ReactiveX#887: Merged spring cloud common with spring cloud 2 m…
…odule (ReactiveX#899)
- Loading branch information
Showing
19 changed files
with
223 additions
and
317 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
...ithub/resilience4j/bulkhead/autoconfigure/AbstractRefreshScopedBulkheadConfiguration.java
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
...ence4j/circuitbreaker/autoconfigure/AbstractRefreshScopedCircuitBreakerConfiguration.java
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
...resilience4j/ratelimiter/autoconfigure/AbstractRefreshScopedRateLimiterConfiguration.java
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
...a/io/github/resilience4j/retry/autoconfigure/AbstractRefreshScopedRetryConfiguration.java
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
...resilience4j/timelimiter/autoconfigure/AbstractRefreshScopedTimeLimiterConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 61 additions & 2 deletions
63
...io/github/resilience4j/bulkhead/autoconfigure/RefreshScopedBulkheadAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,78 @@ | ||
package io.github.resilience4j.bulkhead.autoconfigure; | ||
|
||
import io.github.resilience4j.bulkhead.Bulkhead; | ||
import io.github.resilience4j.bulkhead.BulkheadRegistry; | ||
import io.github.resilience4j.bulkhead.ThreadPoolBulkhead; | ||
import io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry; | ||
import io.github.resilience4j.bulkhead.configure.BulkheadConfiguration; | ||
import io.github.resilience4j.bulkhead.configure.BulkheadConfigurationProperties; | ||
import io.github.resilience4j.bulkhead.configure.threadpool.ThreadPoolBulkheadConfiguration; | ||
import io.github.resilience4j.bulkhead.event.BulkheadEvent; | ||
import io.github.resilience4j.common.CompositeCustomizer; | ||
import io.github.resilience4j.common.bulkhead.configuration.BulkheadConfigCustomizer; | ||
import io.github.resilience4j.common.bulkhead.configuration.ThreadPoolBulkheadConfigCustomizer; | ||
import io.github.resilience4j.common.bulkhead.configuration.ThreadPoolBulkheadConfigurationProperties; | ||
import io.github.resilience4j.consumer.EventConsumerRegistry; | ||
import io.github.resilience4j.core.registry.RegistryEventConsumer; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.boot.autoconfigure.AutoConfigureAfter; | ||
import org.springframework.boot.autoconfigure.AutoConfigureBefore; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration; | ||
import org.springframework.cloud.context.scope.refresh.RefreshScope; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
|
||
@Configuration | ||
@ConditionalOnClass({Bulkhead.class, RefreshScope.class}) | ||
@AutoConfigureAfter(RefreshAutoConfiguration.class) | ||
@AutoConfigureBefore(BulkheadAutoConfiguration.class) | ||
public class RefreshScopedBulkheadAutoConfiguration extends | ||
AbstractRefreshScopedBulkheadConfiguration { | ||
public class RefreshScopedBulkheadAutoConfiguration { | ||
protected final BulkheadConfiguration bulkheadConfiguration; | ||
protected final ThreadPoolBulkheadConfiguration threadPoolBulkheadConfiguration; | ||
|
||
protected RefreshScopedBulkheadAutoConfiguration() { | ||
this.threadPoolBulkheadConfiguration = new ThreadPoolBulkheadConfiguration(); | ||
this.bulkheadConfiguration = new BulkheadConfiguration(); | ||
} | ||
|
||
/** | ||
* @param bulkheadConfigurationProperties bulkhead spring configuration properties | ||
* @param bulkheadEventConsumerRegistry the bulkhead event consumer registry | ||
* @return the RefreshScoped BulkheadRegistry | ||
*/ | ||
@Bean | ||
@org.springframework.cloud.context.config.annotation.RefreshScope | ||
@ConditionalOnMissingBean | ||
public BulkheadRegistry bulkheadRegistry( | ||
BulkheadConfigurationProperties bulkheadConfigurationProperties, | ||
EventConsumerRegistry<BulkheadEvent> bulkheadEventConsumerRegistry, | ||
RegistryEventConsumer<Bulkhead> bulkheadRegistryEventConsumer, | ||
@Qualifier("compositeBulkheadCustomizer") CompositeCustomizer<BulkheadConfigCustomizer> compositeBulkheadCustomizer) { | ||
return bulkheadConfiguration | ||
.bulkheadRegistry(bulkheadConfigurationProperties, bulkheadEventConsumerRegistry, | ||
bulkheadRegistryEventConsumer, compositeBulkheadCustomizer); | ||
} | ||
|
||
/** | ||
* @param threadPoolBulkheadConfigurationProperties thread pool bulkhead spring configuration | ||
* properties | ||
* @param bulkheadEventConsumerRegistry the bulk head event consumer registry | ||
* @return the RefreshScoped ThreadPoolBulkheadRegistry | ||
*/ | ||
@Bean | ||
@org.springframework.cloud.context.config.annotation.RefreshScope | ||
@ConditionalOnMissingBean | ||
public ThreadPoolBulkheadRegistry threadPoolBulkheadRegistry( | ||
ThreadPoolBulkheadConfigurationProperties threadPoolBulkheadConfigurationProperties, | ||
EventConsumerRegistry<BulkheadEvent> bulkheadEventConsumerRegistry, | ||
RegistryEventConsumer<ThreadPoolBulkhead> threadPoolBulkheadRegistryEventConsumer, | ||
@Qualifier("compositeThreadPoolBulkheadCustomizer") CompositeCustomizer<ThreadPoolBulkheadConfigCustomizer> compositeThreadPoolBulkheadCustomizer) { | ||
|
||
return threadPoolBulkheadConfiguration.threadPoolBulkheadRegistry( | ||
threadPoolBulkheadConfigurationProperties, bulkheadEventConsumerRegistry, | ||
threadPoolBulkheadRegistryEventConsumer, compositeThreadPoolBulkheadCustomizer); | ||
} | ||
} |
Oops, something went wrong.