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

المبادلات والتوجيه

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

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

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

في هذا الدرس

pick the right exchange type.

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

  • Direct: routes on an exact routing key match.
  • Topic: routes by patterns: * matches one word, # matches zero or more. Example order.*.created.
  • Fanout: copies to every bound queue; ignores the key.
  • Headers exchanges also exist but are rare.
  • Unroutable messages are dropped unless configured otherwise (mandatory flag or alternate exchange).
  • Declare exchanges, queues, and bindings in code with Spring AMQP beans.
تفاصيل المخطط المبدئي

عرض عملي

java
@Bean TopicExchange notifications() { return new TopicExchange("notifications"); }
@Bean Queue emailQueue() { return QueueBuilder.durable("email").build(); }
@Bean Binding b(Queue emailQueue, TopicExchange notifications) {
  return BindingBuilder.bind(emailQueue).to(notifications).with("order.#");
}

اختبر فهمك

Which exchange type ignores the routing key?

أظهر الإجابة

Fanout.

التطبيق

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

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

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

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