فحوص الصحة: Liveness مقابل Readiness
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
expose and use the two health signals.
الموضوعات المخطط لها
- Liveness asks: "is the process stuck and in need of a restart?"
- Readiness asks: "can the app take traffic now?" (for example, the database is reachable).
- Spring Boot Actuator exposes
/actuator/health/livenessand/actuator/health/readiness(enable the probes; verify properties for your version). - Do not check the database in liveness: a database outage would restart healthy apps and make things worse.
- Expose only the health endpoint publicly; keep other actuator endpoints private.
تفاصيل المخطط المبدئي
عرض عملي
management:
endpoint.health.probes.enabled: true
endpoints.web.exposure.include: healthاختبر فهمك
Which probe should fail when the database is down?
أظهر الإجابة
Readiness.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.