Unlocking the Power of Communication_ The Intriguing World of Message Brokers.pptx

tonynazarovnz 40 views 35 slides Jun 17, 2024
Slide 1
Slide 1 of 35
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35

About This Presentation

Unlocking the Power of Communication: The Intriguing World of Message Brokers


Slide Content

Unlocking the Power of Communication: The Intriguing World of Message Brokers Part 1 of N… The concepts of Message Brokers / Event Brokers

The concepts of Message Brokers / Event Brokers

The concepts of Message Brokers / Event Brokers What is a Message Broker / Event Broker?

The concepts of Message Brokers / Event Brokers What is a Message Broker / Event Broker? What the differences between Brokers?

The concepts of Message Brokers / Event Brokers What is a Message Broker / Event Broker? What the differences between B rokers ? Why we use M essage B rokers?

The concepts of Message Brokers / Event Brokers What is a Message Broker / Event Broker? What the differences between Brokers? Why we use M essage B rokers? How to start?

The concepts of Message Brokers / Event Brokers What is a Message Broker / Event Broker? What the differences between B rokers ? Why we use M essage B rokers? How to start? What ’ s next? Enjoy!

Popular Message / Event Brokers

What is a Message Broker? Using RabbitMQ as an example:

RabbitMQ (AMQP) Model Exchange with Fanout, Direct, and Topic types provide different strategies for message distribution. Queue stores messages until they are consumed by consumers. Binding specifies how messages are routed from an exchange to a queue. Additional concepts: Produce/Consumer Channel Connection Virtual host Use Cases : Microservices Communication Log Aggregation, Processing, Monitoring Event Driven Architectures Task Queues and Work Distribution High Availability and Disaster Recovery

What is a Event Broker? Using Kafka as an example:

Kafka Model Topic - represents a logical channel and message container for organising and partitioning data streams. Partition - are ordered, immutable sequence of messages. Broker - server responsible for storing and managing partitions. Additional concepts: Produce/Consumer/Consumer Groups Offset Retention and Compaction Streams/Connect APIs Use Cases: Microservices Communication Log Aggregation,Processing and Monitoring Event Sourcing and CQRS Messaging Stream Processing

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers. Kafka stores messages until consumers acknowledge receipt, ensuring reliable delivery. Message Storage Does not keep any message after acknowledge. Keeps messages in logs. It is possible to reread the message. Delivery guarantees at-least-once, at-most-once. at-least-once, exactly-once, effectively-once. Ordering FIFO, but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order. Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers . Messages exist in patritions until t hey are acknowledged by producer . Message Storage Does not keep any message after acknowledge. Keeps messages in logs. Is is possible to reread the message. Delivery guarantees at-least-once, at-most-once. at-least-once, exactly-once, effectively-once. Ordering FIFO, but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order. Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers. Kafka stores messages until consumers acknowledge receipt, ensuring reliable delivery. Message Storage Does not keep any message after acknowledge. Keeps messages in logs. Is is possible to reread the message. Delivery guarantees at-least-once, at-most-once. at-least-once, exactly-once, effectively-once. Ordering FIFO, but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order. Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers. Kafka stores messages until consumers acknowledge receipt, ensuring reliable delivery. Message Storage Does not keep any message after acknowledge. Keeps messages in logs. Is is possible to reread the message. Delivery guarantees at-least-once , at-most-once. at-least-once , exactly-once , effectively-once. Ordering FIFO, but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order. Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers. Kafka stores messages until consumers acknowledge receipt, ensuring reliable delivery. Message Storage Does not keep any message after acknowledge. Keeps messages in logs. Is is possible to reread the message. Delivery guarantee s at-least-once, at-most-once. at-least-once, exactly-once, effectively-once. Ordering FIFO , but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order . Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

What the Differences Between Brokers? RabbitMQ Kafka Acknowledgment Handling Messages exist in queues until they are acknowledged by consumers. Kafka stores messages until consumers acknowledge receipt, ensuring reliable delivery. Message Storage Does not keep any message after acknowledge. Keeps messages in logs. Is is possible to reread the message. Delivery guarantees at-least-once, at-most-once. at-least-once, exactly-once, effectively-once. Ordering FIFO, but messages can be prioritised or delayed. FIFO within each partition, but does not guarantee order. Broker-consumer model Passive consumer, Active broker model. Active consumer, Passive broker.

Why we use Message Brokers?

Decoupling and Loose Coupling

Asynchronous Communication API is slow (operates synchronously). APIs do not guarantee message ordering between requests. Direct API integration can lead to tight coupling between services. APIs typically do not provide built-in mechanisms for message durability and persistence. API calls are prone to network failures, server timeouts, and other transient errors. …

Reliability and Delivery Guarantees

Scalability and Load Balancing

What are the disadvantages of implementing a message broker?

What are the disadvantages of implementing a message broker? Potential performance bottleneck. Potential single Point of failure. Additional operational complexity - Debugging / Learning curve / Maintenance. Increasing the volume of traffic.

A case study The task requires to send 1 million messages. Users should get their messages within a time period of 1-2pm the same day. Each message is personalised.

How to start? Documentation: https://www.rabbitmq.com/docs https://kafka.apache.org/documentation/ https://activemq.apache.org/components/classic/documentation/ Docker Hub: https://hub.docker.com/_/rabbitmq https://hub.docker.com/r/apache/kafka https://hub.docker.com/r/apache/activemq-classic

How to start? Developer tools : https://www.rabbitmq.com/client-libraries/devtools https://cwiki.apache.org/confluence/display/KAFKA/Clients https://activemq.apache.org/components/classic/documentation/cross-language-clients Books: https://www.oreilly.com/library/view/rabbitmq-in-action/9781935182979/ https://www.oreilly.com/library/view/rabbitmq-in-depth/9781617291005/ https://www.oreilly.com/library/view/kafka-the-definitive/9781492043072/

Whats next? Enjoy! Online simulations: https://tryrabbitmq.com/ https://softwaremill.com/kafka-visualisation/

Thank you
Tags