RocketMQ core concepts

Original English text from RocketMQ official core concept document

Here Insert Picture DescriptionAccording to the above model, we can penetrate into some of the themes in the design of the system message:

  • Parallel consumption
  • Hot consumer issue
  • Consumer Load Balancing
  • Message Routing
  • Multiple connections
  • Canary deployment (gray, A / B)

Producers

Producers will be operational system-generated message to the proxy service. RocketMQ provides multiple modes to transmit: asynchronous (asynchronous), synchronous (Synchronous) and unidirectional (one-way).

Producer Groups

Same role as the producer will be grouped together. Different manufacturers of the same producer group instance is up Contact Agent services for committed or rolled back the transaction to prevent the collapse of the original producer after the transaction.
Warning : Considering the producer at the time of sending the message is very important, each producer group can only have one instance is enabled, no need to prevent producers instance initialization.

consumer

Consumers pull message from the proxy service, delivered to the application consumes. In the user application, the consumer is available in two ways:

Pull consumption

Consumers pull pull message from a proxy service. Once finished pulling batch message, the application process will start spending.

Consumer Push

Push consumer, comprehensive news pulled, consumption process, and maintained in other processes, end users open the callback interface, and is invoked when a message arrives.

Consumer Groups

Producer groups similar to the previously mentioned, the same role consumers will also be grouped together called consumer groups .
Consumer groups are a good way to achieve load balancing, failover, it allows us to be more simple news consumption.
WARNING : consumption of consumer groups in the instance must subscribe to the exact same topic.

theme

Theme for news delivery to provide producers and consumers pull message. The relationship between producer and consumer themes are very liberal. A theme can have zero, one or more messages sent by the producer; in turn, a producer can also send messages to different topics. From the consumer's point of view, a theme can be zero, one or more consumer groups subscribe. In a consumer group, you can subscribe to one or more topics, but to ensure that subscribe to the instance in the group is the same.

News

The message is the message delivered. The message must correspond to the topic, it can be understood as when you write the recipient's address. Message can also contain an optional label (tag) or additional information key. For example, you can set up a natural key for additional news, the development process can go look up the message in the proxy service to diagnose the problem.

message queue

Theme is segmented into one or more sub-theme, "message queue."

label

Tags can also be called a sub-theme, providing additional scalability to users. Different purposes message sent from the same service module can use the same theme and different labels. Tags can make your code remains clear, but also enables the query system RocketMQ provide more effective.

Agency services

Agency services is a key component of RocketMQ. It receives messages sent by the producer, the consumer storage and pulling the processing request. It also stores the metadata information related to the message, including consumer groups, consumer modesty offset, and the topic / queue information.

Naming Service

Naming Service provides information routing and forwarding capabilities. Producer and consumer clients can find topics, and find the corresponding proxy service list.

Message Model

  • Clusters
  • broadcast

Message Sequence

When you use DefaultMQPushConsumer, you can decide to consume messages sequentially or in parallel.

  • Sequential
    order of consumption means that the message will be sent to the producer to order each message queue to consume. If your scenario requires strict control of the global order, and that can only be only one topic in the message queue.
    Warning : If you consume a specific order, the maximum number of concurrent message consumption is the number of consumer groups subscribe message queue.
  • Parallel
    when the parallel consumer news, only the number of parallel message consumption by the consumer client thread pool size limit.
    WARNING : In the parallel mode, the order is not guaranteed message.

Guess you like

Origin blog.csdn.net/pluto4596/article/details/89279728