当前位置:网站首页>Circuitbreaker fuse of resilience4j - circuitbreakerregistry register
Circuitbreaker fuse of resilience4j - circuitbreakerregistry register
2022-06-12 10:11:00 【Wang Rushuang】
One : CircuitBreakerRegistry
from InMemoryCircuitBreakerRegistry Realization , Mainly responsible for their own creation and CircuitBreaker The creation of
Provides 8 Kind of establish CircuitBreakerRegistry Of of() Method ,8 Species creation CircuitBreaker Methods 
The previous article mentioned in CircuitBreakerConfiguration utilize @Bean establish CircuitBreakerRegistry Time to call InMemoryCircuitBreakerRegistry Of of Method ,of Method is called InMemoryCircuitBreakerRegistry Construction method of , The construction method will eventually CircuitBreakerConfig Put it in ConcurrentMap<String, C> configurations
Two : from CircuitBreakerRegistry In order to get CircuitBreaker
CircuitBreakerRegistry Also provided according to fuse name name obtain , Get all and so on CircuitBreaker
/** First get the fuse according to its name ( First call )
* If it doesn't exist , Just use "default" The default configuration creates fuses
* {@inheritDoc}
*/
@Override
public CircuitBreaker circuitBreaker(String name) {
return circuitBreaker(name, getDefaultConfig());
}
/**
* Obtain the fuse according to the name and configuration
* {@inheritDoc}
*/
@Override
public CircuitBreaker circuitBreaker(String name, CircuitBreakerConfig config) {
return circuitBreaker(name, config, HashMap.empty());
}
// establish circuitBreaker example
// If entryMap There's something called name Fuse , Get the fuse , If the fuse is not present , Just use config This configuration creates a new one named name Fuse of entryMap in , Then return
@Override
public CircuitBreaker circuitBreaker(String name, CircuitBreakerConfig config,
io.vavr.collection.Map<String, String> tags) {
return computeIfAbsent(name, () -> CircuitBreaker
.of(name, Objects.requireNonNull(config, CONFIG_MUST_NOT_BE_NULL), getAllTags(tags)));
}
summary
CircuitBreaker The biggest feature CircuitBreakerRegistry Mainly responsible for creating fuse instances
边栏推荐
猜你喜欢

np.meshgrid()函数 以及 三维空间中的坐标位置生成 以及 numpy.repeat()函数介绍

SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000

优质好书助成长 猿辅导携四大出版社推荐“暑期好书”

一文读懂Dfinity生态中的首个NFT平台:IMPOSSIBLE THINGS

Basic use of scratch

SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
![[CEGUI] resource loading process](/img/52/819843db21549b5e5031258f2c5cb0.jpg)
[CEGUI] resource loading process

Research progress of DNA digital information storage

Transport layer protocol -- TCP protocol

001: what is a data lake?
随机推荐
one
2021-02-12
[Wayland] Wayland introduction and customized guidance
Clickhouse column basic data type description
哈希表的线性探测法代码实现
np. Meshgrid() function and coordinate position generation in 3D space and numpy Introduction to repeat() function
HALCON联合C#检测表面缺陷——仿射变换(三)
JVM (V) Virtual machine class loading (parental delegation mechanism)
SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
Tp6 debugging (trace)
7-13 地下迷宫探索(邻接表)
tp6调试(trace)
Canal ha mode configuration
markdown_图片并排的方案
Antique mfc/gdi+ Frame LCD display control
优质好书助成长 猿辅导携四大出版社推荐“暑期好书”
Dazzle the "library" action - award solicitation from the golden warehouse of the National People's Congress - high availability failover and recovery of kingbasees cluster
【系统分析师之路】第十八章 复盘系统安全分析与设计
Access and traversal of string class objects
在App内跳转微信,打开微信