انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-052-L04

فحوص الصحة: Liveness مقابل Readiness

  • الدرس 4 من 7
  • Junior
في هذا الدرس 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/liveness and /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.
تفاصيل المخطط المبدئي

عرض عملي

yaml
management:
  endpoint.health.probes.enabled: true
  endpoints.web.exposure.include: health

اختبر فهمك

Which probe should fail when the database is down?

أظهر الإجابة

Readiness.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.