Search in sources :

Example 1 with Requires

use of io.micronaut.context.annotation.Requires in project resilience4j by resilience4j.

the class ThreadPoolBulkheadFactory method threadPoolBulkheadRegistry.

@Singleton
@Requires(beans = ThreadPoolBulkheadConfigurationProperties.class)
public ThreadPoolBulkheadRegistry threadPoolBulkheadRegistry(ThreadPoolBulkheadConfigurationProperties bulkheadConfigurationProperties, @ThreadPoolBulkheadQualifier EventConsumerRegistry<BulkheadEvent> bulkheadEventConsumerRegistry, @ThreadPoolBulkheadQualifier RegistryEventConsumer<ThreadPoolBulkhead> threadPoolBulkheadRegistryEventConsumer, @ThreadPoolBulkheadQualifier CompositeCustomizer<ThreadPoolBulkheadConfigCustomizer> compositeThreadPoolBulkheadCustomizer) {
    ThreadPoolBulkheadRegistry bulkheadRegistry = createBulkheadRegistry(bulkheadConfigurationProperties, threadPoolBulkheadRegistryEventConsumer, compositeThreadPoolBulkheadCustomizer);
    registerEventConsumer(bulkheadRegistry, bulkheadEventConsumerRegistry, bulkheadConfigurationProperties);
    bulkheadConfigurationProperties.getBackends().forEach((name, properties) -> bulkheadRegistry.bulkhead(name, bulkheadConfigurationProperties.createThreadPoolBulkheadConfig(name, compositeThreadPoolBulkheadCustomizer)));
    return bulkheadRegistry;
}
Also used : ThreadPoolBulkheadRegistry(io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry) Requires(io.micronaut.context.annotation.Requires) Singleton(javax.inject.Singleton)

Example 2 with Requires

use of io.micronaut.context.annotation.Requires in project resilience4j by resilience4j.

the class CircuitBreakerRegistryFactory method circuitBreakerRegistry.

@Singleton
@Requires(beans = CircuitBreakerProperties.class)
public CircuitBreakerRegistry circuitBreakerRegistry(CircuitBreakerConfigurationProperties circuitBreakerConfigurationProperties, @CircuitBreakerQualifier EventConsumerRegistry<CircuitBreakerEvent> eventConsumerRegistry, @CircuitBreakerQualifier RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer, @CircuitBreakerQualifier CompositeCustomizer<CircuitBreakerConfigCustomizer> compositeCircuitBreakerCustomizer) {
    CircuitBreakerRegistry circuitBreakerRegistry = createCircuitBreakerRegistry(circuitBreakerConfigurationProperties, circuitBreakerRegistryEventConsumer, compositeCircuitBreakerCustomizer);
    registerEventConsumer(circuitBreakerConfigurationProperties, circuitBreakerRegistry, eventConsumerRegistry);
    initCircuitBreakerRegistry(circuitBreakerConfigurationProperties, circuitBreakerRegistry, compositeCircuitBreakerCustomizer);
    return circuitBreakerRegistry;
}
Also used : CircuitBreakerRegistry(io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry) Requires(io.micronaut.context.annotation.Requires) Singleton(javax.inject.Singleton)

Example 3 with Requires

use of io.micronaut.context.annotation.Requires in project resilience4j by resilience4j.

the class RetryRegistryFactory method createRetryRegistry.

@Singleton
@Requires(beans = RetryConfigurationProperties.class)
public RetryRegistry createRetryRegistry(RetryConfigurationProperties retryConfigurationProperties, @RetryQualifier EventConsumerRegistry<RetryEvent> retryEventConsumerRegistry, @RetryQualifier RegistryEventConsumer<Retry> retryRegistryEventConsumer, @RetryQualifier CompositeCustomizer<RetryConfigCustomizer> compositeRetryCustomizer) {
    RetryRegistry retryRegistry = createRetryRegistry(retryConfigurationProperties, retryRegistryEventConsumer, compositeRetryCustomizer);
    registerEventConsumer(retryRegistry, retryEventConsumerRegistry, retryConfigurationProperties);
    retryConfigurationProperties.getInstances().forEach((name, properties) -> retryRegistry.retry(name, retryConfigurationProperties.createRetryConfig(name, compositeRetryCustomizer)));
    return retryRegistry;
}
Also used : RetryRegistry(io.github.resilience4j.retry.RetryRegistry) Requires(io.micronaut.context.annotation.Requires) Singleton(javax.inject.Singleton)

Example 4 with Requires

use of io.micronaut.context.annotation.Requires in project resilience4j by resilience4j.

the class BulkHeadRegistryFactory method bulkheadRegistry.

@Singleton
@Requires(beans = BulkheadProperties.class)
public BulkheadRegistry bulkheadRegistry(BulkheadConfigurationProperties bulkheadConfigurationProperties, @BulkheadQualifier EventConsumerRegistry<BulkheadEvent> bulkheadEventConsumerRegistry, @BulkheadQualifier RegistryEventConsumer<Bulkhead> bulkheadRegistryEventConsumer, @BulkheadQualifier CompositeCustomizer<BulkheadConfigCustomizer> compositeBulkheadCustomizer) {
    BulkheadRegistry bulkheadRegistry = createBulkheadRegistry(bulkheadConfigurationProperties, bulkheadRegistryEventConsumer, compositeBulkheadCustomizer);
    registerEventConsumer(bulkheadRegistry, bulkheadEventConsumerRegistry, bulkheadConfigurationProperties);
    bulkheadConfigurationProperties.getInstances().forEach((name, properties) -> bulkheadRegistry.bulkhead(name, bulkheadConfigurationProperties.createBulkheadConfig(properties, compositeBulkheadCustomizer, name)));
    return bulkheadRegistry;
}
Also used : BulkheadRegistry(io.github.resilience4j.bulkhead.BulkheadRegistry) Requires(io.micronaut.context.annotation.Requires) Singleton(javax.inject.Singleton)

Example 5 with Requires

use of io.micronaut.context.annotation.Requires in project resilience4j by resilience4j.

the class TimeLimiterRegistryFactory method timeLimiterRegistry.

@Singleton
@Requires(beans = TimeLimiterConfigurationProperties.class)
public TimeLimiterRegistry timeLimiterRegistry(TimeLimiterConfigurationProperties timeLimiterConfigurationProperties, @TimeLimiterQualifier EventConsumerRegistry<TimeLimiterEvent> timeLimiterEventConsumerRegistry, @TimeLimiterQualifier RegistryEventConsumer<TimeLimiter> timeLimiterRegistryEventConsumer, @TimeLimiterQualifier CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) {
    TimeLimiterRegistry timeLimiterRegistry = createTimeLimiterRegistry(timeLimiterConfigurationProperties, timeLimiterRegistryEventConsumer, compositeTimeLimiterCustomizer);
    registerEventConsumer(timeLimiterRegistry, timeLimiterEventConsumerRegistry, timeLimiterConfigurationProperties);
    initTimeLimiterRegistry(timeLimiterRegistry, timeLimiterConfigurationProperties, compositeTimeLimiterCustomizer);
    return timeLimiterRegistry;
}
Also used : TimeLimiterRegistry(io.github.resilience4j.timelimiter.TimeLimiterRegistry) Requires(io.micronaut.context.annotation.Requires) Singleton(javax.inject.Singleton)

Aggregations

Requires (io.micronaut.context.annotation.Requires)8 Singleton (javax.inject.Singleton)5 EachBean (io.micronaut.context.annotation.EachBean)2 GoogleCredentials (com.google.auth.oauth2.GoogleCredentials)1 BulkheadRegistry (io.github.resilience4j.bulkhead.BulkheadRegistry)1 ThreadPoolBulkheadRegistry (io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry)1 CircuitBreakerRegistry (io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry)1 RetryRegistry (io.github.resilience4j.retry.RetryRegistry)1 TimeLimiterRegistry (io.github.resilience4j.timelimiter.TimeLimiterRegistry)1 Primary (io.micronaut.context.annotation.Primary)1 ConfigurationException (io.micronaut.context.exceptions.ConfigurationException)1 EndSessionEndpoint (io.micronaut.security.oauth2.endpoint.endsession.request.EndSessionEndpoint)1 JwksSignature (io.micronaut.security.token.jwt.signature.jwks.JwksSignature)1 JwksSignatureConfigurationProperties (io.micronaut.security.token.jwt.signature.jwks.JwksSignatureConfigurationProperties)1 Singleton (jakarta.inject.Singleton)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 Base64 (java.util.Base64)1