انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-028-L05

Spring for Apache Kafka

  • الدرس 5 من 9
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

produce and consume from Spring.

الموضوعات المخطط لها

  • KafkaTemplate sends records; @KafkaListener consumes.
  • Configure serializers (String, JSON) and the consumer group-id in application.yml.
  • Set the listener ack mode (default commits after the batch is processed; MANUAL for control).
  • Use a JSON serializer with a trusted-packages setting, or a schema registry (MID-029).
  • auto.offset.reset decides where a new group starts (earliest or latest).
  • Check configuration names against the Spring Boot version before recording.
تفاصيل المخطط المبدئي

عرض عملي

java
kafka.send("orders", order.id(), new OrderPlaced(order.id(), order.total()));

@KafkaListener(topics = "orders", groupId = "inventory")
void on(OrderPlaced e) { reserve(e); }

اختبر فهمك

Which property gives each service its own copy of all events?

أظهر الإجابة

A distinct group-id.

التطبيق

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

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

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

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