عرض عملي: ماذا تفعل إعادة الموازنة (rebalance) بالرسائل قيد المعالجة
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
observe duplicate delivery on rebalance. Prepares MID-028-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Start two
inventoryconsumers; note partition assignments. - Make the handler slow (5 s) and record each processed
eventId. - Kill one consumer mid-processing; watch partitions reassign.
- The surviving consumer re-reads from the last committed offset; show a message processed twice.
- Planned mistake: enable auto-commit before processing and show a message lost on a crash. Fix by committing after processing.
- Add an idempotency check on
eventIdand replay; the duplicate no longer has an effect.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.