Message processing method and device, electronic equipment and readable storage medium

A message processing and message technology, applied in the field of data processing, can solve problems such as blocking and affecting the message consumption efficiency of message queues

CN111585867AActive Publication Date: 2020-08-25BEIJING QIYI CENTURY SCI & TECH CO LTD
8 Cites 3 Cited by

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
Publication Date
2020-08-25

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The embodiment of the invention provides a message processing method and device, electronic equipment and a readable storage medium. The method comprises the following steps: receiving a first messagesent by the production server, storing the first message in a message queue corresponding to the service type of the first message, obtaining M first messages from the message queue, writing each first message into a first memory buffer queue corresponding to the first target service identifier by adopting M first threads, determining a first target service address associated with the first target service identifier, and reading the N first messages in the first memory buffer queue by adopting the N second threads, and sending the N first request messages to a target server corresponding to the first target service address so as to call the service corresponding to the target server for N times to process the N first messages. Therefore, quick reading operation can be realized, accumulation of the messages in the message queue is avoided to a certain extent, and the consumption efficiency of the messages in the message queue is improved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of data processing, in particular to a message processing method, device, electronic equipment and a readable storage medium. Background technique

[0002] Because the system based on the microservice architecture is easy to develop and maintain, it has been applied to the development of larger projects. At the same time, in order to realize the coupling between microservices, asynchronous message processing, current limiting and peak shaving and other functions, the production and consumption mode is usually applied.

[0003] The production and consumption mode is specifically: the server that publishes the message (production server) publishes the message to the message queue (MQ, Message Queue) in the production server cluster, a message queue is a buffer, and the server that consumes the message (consumer server) reads the Take out the message and process the message. After processing a message, continu...

Examples

Embodiment Construction

[0026] The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.

[0027] refer to figure 1 , figure 1 It is a system architecture diagram in the prior art. The system architecture includes a production server, a storage server, a consumption server 1 and a consumption server 2 as an example. The production server publishes messages to the message queue of the storage server. There can be at least one message queue of the storage server. Each message queue stores messages of a business type, and each business type is a business scenario. For example, message queue 1 stores information about For the message of liking the video, the message queue 2 stores the message about commenting on the video. In the prior art, if consumer server 1 is configured to take out messages from message queue 1, and consumer server 2 is configured to take out messages from message queue 2,...