You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m struggling to understand wrapping concept for WaitAndRetry (WR), Circuit Breaker(CB) and Fallback (FB) policies all together. Specifically, I’m referring to the table “Ordering the available policy-types in a wrap” in the Wiki Can someone please clarify?
Scenario 1. WR wraps CB. Wiki suggests to have CB’s break time shorter then waiting time in WR. In this case, CB will able to open and close between tries. So, what is the meaning of the circuit breaker then, if no calls to its open state, i.e., able to “use” its open state? If in this scenario break time is longer than WR’s waiting time, then it’s simply equal to lesser number of retries because it seems retries to the open state will be immediately thrown, so no reason to plan such “hopeless” retries in advance.
I can’t understand reasoning of such scenario at all.
Scenario 2. CB wraps WR. I’m struggling to understand how fails are counted for CB in this scenario. If all retries of WR are counted, does it mean that number of fails for CB should be exactly equal to WR’s number of retries? Otherwise, if CB’s config number of fails less than WR’s retries, then WR has no chance to execute all retries. If CB fails greater than WR retries, than CB has no chance to switch to the open state, because CB does not trigger retries. Or, maybe CB counts fails of WR itself (when all retries are over)? Meaning, if CB fails = 5 and WR = 5, we need to have 5 external calls, to have make total 5*5=25 calls to the world, to switch CB to open state?
Furthermore, it’s unclear how to wrap Fallback policy then. Wiki says it “Can also be used mid-wrap ... eg as a failover strategy”. This is my case,
Let’s say we have Policy.Wrap(CB, FB, WR) and for CB number of fails = 5 and WR retries = 5. Then, on the fifth retry CB will be opened, then seems no chance for FB to execute. If the CB = 7 and WR = 5, then who will make retry to execute FB? For me it looks like if the number of fails for CB should be exactly equal to WR’s number of retries, then there is no room for FB.
The text was updated successfully, but these errors were encountered:
I’m struggling to understand wrapping concept for WaitAndRetry (WR), Circuit Breaker(CB) and Fallback (FB) policies all together. Specifically, I’m referring to the table “Ordering the available policy-types in a wrap” in the Wiki Can someone please clarify?
Scenario 1. WR wraps CB. Wiki suggests to have CB’s break time shorter then waiting time in WR. In this case, CB will able to open and close between tries. So, what is the meaning of the circuit breaker then, if no calls to its open state, i.e., able to “use” its open state? If in this scenario break time is longer than WR’s waiting time, then it’s simply equal to lesser number of retries because it seems retries to the open state will be immediately thrown, so no reason to plan such “hopeless” retries in advance.
I can’t understand reasoning of such scenario at all.
Scenario 2. CB wraps WR. I’m struggling to understand how fails are counted for CB in this scenario. If all retries of WR are counted, does it mean that number of fails for CB should be exactly equal to WR’s number of retries? Otherwise, if CB’s config number of fails less than WR’s retries, then WR has no chance to execute all retries. If CB fails greater than WR retries, than CB has no chance to switch to the open state, because CB does not trigger retries. Or, maybe CB counts fails of WR itself (when all retries are over)? Meaning, if CB fails = 5 and WR = 5, we need to have 5 external calls, to have make total 5*5=25 calls to the world, to switch CB to open state?
Furthermore, it’s unclear how to wrap Fallback policy then. Wiki says it “Can also be used mid-wrap ... eg as a failover strategy”. This is my case,
Let’s say we have
Policy.Wrap(CB, FB, WR)
and for CB number of fails = 5 and WR retries = 5. Then, on the fifth retry CB will be opened, then seems no chance for FB to execute. If the CB = 7 and WR = 5, then who will make retry to execute FB? For me it looks like if the number of fails for CB should be exactly equal to WR’s number of retries, then there is no room for FB.The text was updated successfully, but these errors were encountered: