ru.tinkoff.kora.resilient.fallback.FallbackModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resilient-kora Show documentation
Show all versions of resilient-kora Show documentation
Kora resilient-kora module
package ru.tinkoff.kora.resilient.fallback;
import jakarta.annotation.Nullable;
import ru.tinkoff.kora.application.graph.All;
import ru.tinkoff.kora.config.common.Config;
import ru.tinkoff.kora.config.common.extractor.ConfigValueExtractor;
public interface FallbackModule {
default FallbackConfig koraFallbackConfig(Config config, ConfigValueExtractor extractor) {
var value = config.get("resilient");
return extractor.extract(value);
}
default FallbackManager koraFallbackManager(FallbackConfig config,
All failurePredicates,
@Nullable FallbackMetrics metrics) {
return new KoraFallbackManager(config, failurePredicates,
(metrics == null)
? NoopFallbackMetrics.INSTANCE
: metrics);
}
default FallbackPredicate defaultFallbackFailurePredicate() {
return new KoraFallbackPredicate();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy