تصميم حمولات الأحداث
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
choose the content of an event.
الموضوعات المخطط لها
- Include:
eventId(unique, for deduplication),type,occurredAt,version(schema), the aggregate ID, and key business data. - Minimal (notification) event: IDs only; consumers call back for details, which adds coupling and load.
- Full-state event: carries the data consumers need; larger, but consumers stay autonomous.
- A middle path: carry the facts that changed or that most consumers need, not entire database rows.
- Evolve schemas compatibly: add optional fields, never reuse or retype fields (schema registry, MID-029).
تفاصيل المخطط المبدئي
عرض عملي
{ "eventId": "a1b2...", "type": "OrderPlaced", "version": 1,
"occurredAt": "2026-03-01T10:15:30Z",
"data": { "orderId": "o-42", "customerId": "c-7", "total": "59.90", "currency": "EUR" } }اختبر فهمك
What is the eventId for?
أظهر الإجابة
Uniquely identifying the event so consumers can detect duplicates.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.