قواطع الدارة
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
stop calling a failing dependency and probe for recovery.
الموضوعات المخطط لها
- States: closed (calls pass), open (calls fail fast), half-open (a few trial calls).
- Open when failure rate or slow-call rate crosses a threshold in a sliding window.
- Failing fast frees threads and gives the dependency room to recover.
- Count only relevant failures (5xx, timeouts), not 4xx business errors.
- Test it: a breaker that was never opened in a test may be misconfigured.
تفاصيل المخطط المبدئي
عرض عملي
CircuitBreakerConfig cfg = CircuitBreakerConfig.custom()
.slidingWindowSize(20).failureRateThreshold(50)
.slowCallDurationThreshold(Duration.ofMillis(500)).slowCallRateThreshold(50)
.waitDurationInOpenState(Duration.ofSeconds(10))
.permittedNumberOfCallsInHalfOpenState(3).build();اختبر فهمك
What does an open breaker do with a new call?
أظهر الإجابة
Rejects it immediately without contacting the dependency.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.