The next step is a brief overview of RocketMQ’s architecture and role as a whole.

architecture

Just look at the picture. A picture is worth a thousand words

  • Before sending messages, the Producer pulls routing information from the NameServer
  • Producer obtains routing information and sends it to the Broker
  • Consumer Pulls routing information from the NameServer before consuming information
  • Consumer message information

But producers and consumers pull routing information from NameServer based on what.

Let’s start by zooming in on the Broker and examining the internal details

A quick summary:

  • Borker has one or more topics
  • There are one or more MessageQueue in a Topic

Instead, producers and consumers find the Broker holding the Topic in the NameServer based on Topic. MessageQueue under Topic is then polled when sending a message, for example, the first message is sent to MessageQueue1, and the second message is sent to MessageQueue2.

If you want to dig a little deeper, you can look at this code: Poll MessageQueue

role

  • Producer: indicates the sender of messages. The analogy is: sender
  • Consumer: The recipient of the message. The analogy is: the recipient
  • NameServer: Manages routing information for brokers and topics. The analogy is router
  • Broker: Stores and transmits messages. The analogy: the post office
  • Topic: Differentiates the types of messages
  • MessageQueue: Channel for sending and receiving messages.

What is the relationship between Topic and Producer?

  • Many-to-many: A producer can send messages to one or more topics; A Topic can also be sent by multiple producers.

What is the relationship between Topic and Consumer?

  • Many-to-many: a Consuemr can subscribe to one or more Topic messages; A Topic message can be subscribed by different consumers.

Relationship between Broker and Topic?

  • Many-to-many: A single Broker can hold many different topics; A Topic can also be placed on multiple brokers.

The relationship between Topic and MessageQueue?

  • One-to-many: A Topic can have more than one MessageQueue. But a MessageQueue can only belong to one Topic.

The relationship between Broker and NameServer?

  • A Broker needs to be registered with all NameserVers.

conclusion

This section briefly shares the RocketMQ architecture diagram and the relationship between roles to get an overview of RocketMQ.

Subsequent articles

  • RocketMQ- Getting Started (updated)
  • RocketMQ- Architecture and Roles (updated)
  • RocketMQ- Message Sending (updated)
  • RocketMQ- Consumption information
  • RocketMQ- Broadcast mode and Cluster Mode for Consumers (updated)
  • RocketMQ- Sequential messages
  • RocketMQ- Delayed messages
  • RocketMQ- Batch messaging
  • RocketMQ- Filters messages
  • RocketMQ- Transaction messages
  • RocketMQ- Message store
  • RocketMQ – high availability
  • RocketMQ – high performance
  • RocketMQ- Primary/secondary replication
  • RocketMQ- Swiping mechanism
  • RocketMQ – idempotence
  • RocketMQ- Message retry
  • RocketMQ- Dead letter queue

.

Welcome to join (guan) unit (Zhu), the follow-up article dry goods.