[go: up one dir, main page]

CN111858099A - Message subscription method and device - Google Patents

Message subscription method and device Download PDF

Info

Publication number
CN111858099A
CN111858099A CN202010725994.9A CN202010725994A CN111858099A CN 111858099 A CN111858099 A CN 111858099A CN 202010725994 A CN202010725994 A CN 202010725994A CN 111858099 A CN111858099 A CN 111858099A
Authority
CN
China
Prior art keywords
message
server
subscription
client
platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010725994.9A
Other languages
Chinese (zh)
Other versions
CN111858099B (en
Inventor
王珂伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Haier Uplus Intelligent Technology Beijing Co Ltd
Priority to CN202010725994.9A priority Critical patent/CN111858099B/en
Publication of CN111858099A publication Critical patent/CN111858099A/en
Application granted granted Critical
Publication of CN111858099B publication Critical patent/CN111858099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a message subscription method and a device, wherein the method comprises the following steps: the server side initiates message subscription to the platform according to the message subscription request of the client side; the server receives the message returned by the platform according to the subscription and sends the message to the client; and when the server side has message backlog, the server side controls the speed of subscribing the message to the platform according to the message volume consumed by the client side. In the invention, when the server side has the message backlog, the server side can control the speed of subscribing the message to the platform according to the message amount consumed by the client side, so that the problem that when the backlog reaches a certain amount, the server side has service fault or service memory fault, which causes all subscription faults can be solved, and the effect of good interaction between the server side and the client side is achieved.

Description

Message subscription method and device
Technical Field
The present invention relates to the field of message processing, and in particular, to a message subscription method and apparatus.
Background
WebSocket is a network transport protocol that enables full-duplex communication over a single TCP connection and is located at the application layer of the OSI model. WebSocket enables data exchange between the client and the server to be simpler, and allows the server to actively push data to the client. In the WebSocket API, the browser and the server only need to complete one handshake, and persistent connection can be established between the browser and the server, and bidirectional data transmission is carried out.
Kafka is an open source stream processing platform developed by the Apache software foundation, written in Scala and Java. The goal of this project is to provide a uniform, high-throughput, low-latency platform for processing real-time data. Its persistence layer is essentially a "large-scale publish/subscribe message queue in a distributed transaction log architecture," which makes it very valuable as an enterprise-level infrastructure to handle streaming data. Further, Kafka can be connected to an external system (for data input/output) through Kafka Connect, and Kafka Streams, a Java streaming library, is provided.
When the websocket is used for kafka data subscription, the websocket server side bears data channels of the client and the kafka, and when the data volume is large, the number of clients is large, or the consumption of the client is slow, all data will be backlogged to the websocket server side, which can cause the server side to hang up or cause a failure of a service memory.
Disclosure of Invention
The embodiment of the invention provides a message subscription method and a message subscription device, which are used for at least solving the problem of service failure or service memory failure caused by data backlog in data subscription in the related technology.
According to an embodiment of the present invention, there is provided a message subscription method, including: the server side initiates message subscription to the platform according to the message subscription request of the client side; the server receives the message returned by the platform according to the subscription and sends the message to the client; when the server side has message backlog, the server side controls the speed of subscribing the message to the platform according to the message amount consumed by the client side, so that the speed of subscribing the message to the platform is less than or equal to the speed of consuming the message by the client side.
Optionally, the server controlling, according to the message amount consumed by the client, the speed of subscribing the message to the platform by the server may include: the server side suspends the initiation of message subscription to the platform; the server side counts the message volume sent to the client side; and when the statistical message amount reaches a first threshold value, the server side submits a message subscription of a second threshold value to the platform, wherein the first threshold value is greater than or equal to the second threshold value.
Optionally, before the server submits the message subscription of the second threshold to the platform, the method further includes: and the server selects the message subscription with the second threshold value submitted to the platform according to the priority and/or the subscription message type of the message subscription request.
Optionally, before the server submits the message subscription of the second threshold to the platform, the method further includes: and the server side selects and discards part of the message subscription requests according to the priority and/or the subscription message type of the message subscription requests.
Optionally, before the server initiates a message subscription to the platform according to the message subscription request of the client, the method may further include: and the server receives a message subscription request initiated by the client.
Optionally, the initiating, by the server, a message subscription to the platform according to the message subscription request of the client may include: and the server side carries the request parameters to initiate message subscription to the platform.
Optionally, before the server sends the message to the client, the method may further include: and the server side performs data processing on the returned corresponding message according to the message subscription request of the client side.
Optionally, the server is a websocket server, the customer server is a websocket client, and the platform is a kafka platform.
According to another embodiment of the present invention, there is provided a message subscription apparatus including: the subscription module is used for initiating message subscription to the platform according to the message subscription request of the client; the issuing module is used for receiving the message returned by the platform according to the subscription and issuing the message to the client; and the control module is used for controlling the speed of subscribing the message to the platform according to the message volume consumed by the client by the server under the condition that the server has message backlog, so that the speed of subscribing the message to the platform is less than or equal to the speed of consuming the message by the client.
Optionally, the control module may include: a suspension unit, configured to suspend initiating a message subscription to the platform; the statistical unit is used for counting the message volume sent to the client; a submitting unit, configured to submit a message subscription of a second threshold to the platform when the statistical message amount reaches a first threshold, where the first threshold is greater than or equal to the second threshold.
Optionally, the server is a websocket server, the customer server is a websocket client, and the platform is a kafka platform.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
In the embodiment of the invention, when the server side has the message backlog, the server side can control the speed of subscribing the message to the platform according to the message amount consumed by the client side, so that the problem that when the backlog reaches a certain amount, the server side has service faults or service memory faults, which causes all subscription faults can be solved, and the effect of good interaction between the server side and the client side is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a message subscription method according to an embodiment of the present invention;
fig. 2 is a block diagram of a structure of a message subscription apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of a message subscription apparatus according to an alternative embodiment of the present invention;
fig. 4 is a service timing diagram of a message subscription method according to an embodiment of the present invention;
FIG. 5 is a flow chart of a message subscription backpressure mechanism implementation method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a message subscription backpressure mechanism according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
In this embodiment, a message subscription method is provided, and fig. 1 is a flowchart of a message subscription method according to an embodiment of the present invention, as shown in fig. 1, the flowchart includes the following steps:
step S102, the server side initiates message subscription to the platform according to the message subscription request of the client side.
In this embodiment, the server first receives a message subscription request initiated by the client, where the number of the clients may be multiple, and the type of the message subscription may also be multiple, for example, various types of smart home devices subscribe to messages through the server, and the subscribed messages may be voice messages, device control commands, APP messages, and the like. And the server initiates message subscription to the platform according to the message subscription request carrying the relevant request parameters.
And step S104, the server receives the message returned by the platform according to the subscription and sends the message to the client.
In this embodiment, before the server sends the returned subscription message to the corresponding client, the server performs data processing on the returned message according to the message subscription request of the client. For example, the server may, according to the message type subscribed by the client being a voice message, a device control command, an APP message, or the like, re-split and assemble the returned message according to the format requirement of the message type, and then send the message to the corresponding client.
Step S106, when the server side has message backlog, the server side controls the speed of subscribing the message to the platform according to the message amount consumed by the client side, so that the speed of subscribing the message to the platform is less than or equal to the speed of consuming the message by the client side.
In this embodiment, if the client fails or the consumption speed is slow, the returned message data is backlogged to the server, the temporarily backlogged data is usually stored in the memory of the server, and when the backlogged data reaches a certain amount, the server fails to perform service or fails to perform service memory, resulting in all subscription failures.
In order to solve this problem, a backpressure solving mechanism is introduced in the present embodiment, the backpressure refers to that during the process of transmitting the data stream from the upstream producer to the downstream consumer, the upstream production speed is greater than the downstream consumption speed, so as to cause the memory overflow of the downstream, and this phenomenon is called the backpressure occurrence. In this embodiment, when a backpressure phenomenon occurs, the server controls a speed of subscribing the message to the platform according to the message amount consumed by the client, so that the speed of subscribing the message to the platform is less than or equal to the speed of consuming the message by the client. In this way, the message backlog of the server can be gradually reduced, and the backpressure phenomenon will gradually disappear.
Specifically, in this embodiment, step S106 may include: the server side suspends the initiation of message subscription to the platform; the server side counts the message volume sent to the client side; and when the statistical message amount reaches a first threshold value, the server side submits a message subscription of a second threshold value to the platform, wherein the first threshold value is greater than or equal to the second threshold value. In this embodiment, the server no longer initiates a message subscription to the platform at any time according to the received message subscription request of the client, but performs the message subscription to the platform in batches instead. And controlling the message amount of the message subscription to the platform each time, so that the message amount of the message subscription to the platform is less than or equal to the message amount of the message of the client. In this way, the message backlog of the server can be gradually reduced.
In the above manner that the server controls the message subscription speed to the platform, some other factors, such as the priority of the subscription message, the type of the subscription message, etc., may also be considered comprehensively.
In an exemplary embodiment, when the server has a message backlog, the server suspends initiating message subscription to the platform, on one hand, the server periodically counts the message amount consumed by the client, on the other hand, queues the message subscription requests received from the client according to the priority of the messages, selects part of the message subscription requests with high priority from the queue, and submits the message subscription to the message subscription platform. The amount of the selected and submitted message subscriptions is less than or equal to the amount of messages consumed by the client. Therefore, on one hand, the problem of message backlog of the server side can be solved, and on the other hand, the message subscription request with high priority can be ensured to be subscribed in time.
In another exemplary embodiment, when the server side has a message backlog and submits the message subscription to the message subscription platform in batches, a specific type of message subscription request can be selected to subscribe the message to the message subscription platform according to the type of the message subscription. For example, the server may select an APP type message subscription request.
In another exemplary embodiment, when the server side has a message backlog and submits the message subscriptions to the message subscription platform in batches, part of the message subscription requests with lower priorities may be selected to be discarded according to the priorities of the message subscription requests, so that the total message subscriptions that need to be submitted to the message subscription platform is reduced, and in this way, the message backlog condition of the server side may also be gradually improved.
Of course, in addition to the above-mentioned exemplary modes, the server may also preferentially select the message subscription submitted to the platform or select the message subscription request to be discarded according to other queuing modes.
In this embodiment, the server may be a websocket server, the customer service may be a websocket client, and the platform may be a kafka platform. Kafka is a high-throughput message middleware, is suitable for scenes with large data storage capacity, and when websocket is used for performing Kafka message data subscription, if a websocket client fails or consumes slowly and other reasons, data can be backlogged to a websocket server, temporarily backlogged data is stored in a memory of websocket service, and when the backlogged data reaches a certain amount, the websocket server can have service failure or service memory failure, so that all subscription failures are caused. By adopting the message subscription method provided by the embodiment, when the websocket server side has message backlog, the websocket server side can control the message subscription speed to the Kafka platform according to the message volume consumed by the websocket client side, so that the problem of all subscription faults caused by service faults or service memory faults occurring in the websocket server side when the websocket server side has a certain message backlog is solved, and the benign interaction between the websocket server side and the client side is improved.
Of course, the technical solution for solving the message backlog provided by this embodiment is also applicable to other message processing architectures that may cause backlogs of upstream and downstream messages.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a message subscription apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of which have been already described are omitted. As used below, the terms "module" and "unit" may implement a combination of software and/or hardware of predetermined functions. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a block diagram of a message subscription apparatus according to an embodiment of the present invention, and as shown in fig. 2, the apparatus includes a subscription module 10, a distribution module 30, and a control module 50.
And the subscription module 10 is configured to initiate a message subscription to the platform according to the message subscription request of the client.
And the issuing module 30 is configured to receive a message returned by the platform according to the subscription, and issue the message to the client.
A control module 50, configured to, when a message backlog occurs at the server, control, by the server, a speed of subscribing to the message from the platform according to the message amount consumed by the client.
Fig. 3 is a block diagram of a message subscription apparatus according to an alternative embodiment of the present invention, and as shown in fig. 3, the apparatus includes, in addition to all the modules shown in fig. 2, a control module 50, a pause unit 51, a statistics unit 52, and a submission unit 53.
A suspending unit 51, configured to suspend initiating a message subscription to the platform;
a statistic unit 52, configured to count the message amount sent to the client;
a submitting unit 53, configured to submit a message subscription of a second threshold to the platform when the statistical message amount reaches a first threshold, where the first threshold is greater than or equal to the second threshold.
In this embodiment, the server is a websocket server, the customer server is a websocket client, and the platform is a kafka platform.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
In order to solve the problems in the background art and facilitate understanding of the technical solutions provided by the present invention, a Back Pressure mechanism is added in the embodiments of the present invention when the code is implemented. The present embodiment mainly describes how to implement the backpressure mechanism by using websocket to subscribe to the kafka message. The following detailed description will be made in conjunction with embodiments of specific scenarios.
Kafka is a high-throughput message middleware, is suitable for scenes with large data storage capacity, and when websocket is used for performing Kafka message data subscription, if a websocket client fails or consumes slowly and other reasons, data can be backlogged to a websocket server, temporarily backlogged data is stored in a memory of websocket service, and when the backlogged data reaches a certain amount, the websocket server can have service failure or service memory failure, so that all subscription failures are caused.
In order to solve the problem, a Backpressure mechanism is introduced, wherein Backpressure refers to that during the process that a data stream is transmitted from an upstream producer to a downstream consumer, the upstream production speed is greater than the downstream consumer speed, so that the downstream Buffer overflows, and the phenomenon is called Backpressure.
The embodiment of the invention designs a backpressure mechanism implementation method based on websocket + kafka.
Fig. 4 is a service timing diagram of a message subscription method according to an embodiment of the present invention, as shown in fig. 4, the timing sequence includes the following steps:
step S401, the websocket client side initiates a subscription request to the websocket server side;
step S402, after receiving the request, the websocket server initializes kafka connection, and then initiates subscription to the kafka platform with the request parameters;
step S403, the kafka platform processes data according to the service request of the front end;
step S404, the websocket server receives the data stream returned by the kafka platform;
step S405, the websocket server performs splitting and assembling on the received data;
and step S406, the websocket server returns the assembled data to the websocket client for the service of the subscriber.
The above message subscription method may cause the following problems: the server subscribes to the messages from kafka quickly, the data processing capacity of the client is limited, data is squeezed at the server, and the server hangs up.
To this end, the embodiment of the present invention provides a solution, i.e. a back pressure (Backpressure) mechanism is added at the server side. Fig. 5 is a flowchart of a message subscription backpressure mechanism implementation method according to an embodiment of the present invention, and as shown in fig. 5, the method includes the following steps:
step S351, the service end is changed to subscribe to the kafka so as to manually submit offset;
step S502, counting the message quantity consumed from the client to the server;
step S503, setting a threshold value of the batch consumption amount, for example, the threshold value may be set to 100;
step S504, when the message consumption of the client reaches 100, the server submits the offset of the corresponding data to kafka, i.e. it is ensured that the traffic of the server sink never overflows.
Fig. 6 is a schematic diagram of a message subscription backpressure mechanism according to an embodiment of the present invention, and as shown in fig. 6, the speed of subscribing to a message from kafka is controlled by counting the amount of messages sent to a session channel by a server, so as to ensure the stability of the channel. Namely, the inflow speed of the water tank is controlled according to the outflow speed of the water tank.
According to the embodiment of the invention, through the implementation strategy of the backpressure mechanism of the server, the offset of the kafka is set to be manually submitted, and the message speed of the kafka is controlled through the consumption speed of the client, so that the problem of message backlog of the server when the kafka message is subscribed in a websocket mode is solved, and the stability of the service is improved; the message issuing subscription can be carried out by combining the message middleware with high throughput, namely kafka; the client side can be conveniently used, and the maintenance cost is reduced.
The embodiment of the invention also solves the problem of data pressure of the server when the websocket technology is used for subscribing mass data. The main concern is the mass data, and when the data volume is large, the websocket server interacts with the kafka and the client.
Meanwhile, the embodiment of the invention solves the problems that the version of the client is difficult to upgrade when the client is subscribed in the SDK form, and the problem that the client is difficult to maintain uniformly when the client is subscribed in the SDK form. In addition, the embodiment of the invention provides a subscription mode based on the server, and a user can access the subscription mode quickly and conveniently without paying attention to the server.
Example 4
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, the server side initiates a message subscription to the platform according to the message subscription request of the client side;
s2, the server receives the message returned by the platform according to the subscription, and sends the message to the client;
s3, when the server end has message backlog, the server end controls the speed of subscribing the message to the platform according to the message volume consumed by the client end.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Example 5
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, the server side initiates a message subscription to the platform according to the message subscription request of the client side;
s2, the server receives the message returned by the platform according to the subscription, and sends the message to the client;
s3, when the server end has message backlog, the server end controls the speed of subscribing the message to the platform according to the message volume consumed by the client end.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A message subscription method, comprising:
the server side initiates message subscription to the platform according to the message subscription request of the client side;
the server receives the message returned by the platform according to the subscription and sends the message to the client;
when the server side has message backlog, the server side controls the speed of subscribing the message to the platform to be less than or equal to the speed of consuming the message by the client side.
2. The method of claim 1, wherein the server controls the rate of subscribing messages to the platform to be less than or equal to the rate of consuming messages by the client, comprising:
the server side suspends the initiation of message subscription to the platform;
the server side counts the message volume sent to the client side;
and when the statistical message amount reaches a first threshold value, the server side submits a message subscription of a second threshold value to the platform, wherein the first threshold value is greater than or equal to the second threshold value.
3. The method of claim 2, wherein before the server submits the second threshold of message subscriptions to the platform, further comprising:
and the server selects the message subscription with the second threshold value submitted to the platform according to the priority and/or the subscription message type of the message subscription request.
4. The method of claim 2, wherein before the server submits the second threshold of message subscriptions to the platform, further comprising:
and the server side selects and discards part of the message subscription requests according to the priority and/or the subscription message type of the message subscription requests.
5. The method of claim 1, before the server sends the message to the client, further comprising:
and the server side splits and reassembles the returned corresponding message according to the message type of the message subscription request of the client side.
6. The method of claim 1, wherein the server is a websocket server, the customer server is a websocket client, and the platform is a kafka platform.
7. A message subscription apparatus, located at a server, comprising:
the subscription module is used for initiating message subscription to the platform according to the message subscription request of the client;
the issuing module is used for receiving the message returned by the platform according to the subscription and issuing the message to the client;
and the control module is used for controlling the speed of subscribing the message from the server to the platform to be less than or equal to the speed of consuming the message by the client under the condition that the server has message backlog.
8. The device of claim 7, wherein the server is a websocket server, the customer server is a websocket client, and the platform is a kafka platform.
9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202010725994.9A 2020-07-24 2020-07-24 Message subscription method and device Active CN111858099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010725994.9A CN111858099B (en) 2020-07-24 2020-07-24 Message subscription method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010725994.9A CN111858099B (en) 2020-07-24 2020-07-24 Message subscription method and device

Publications (2)

Publication Number Publication Date
CN111858099A true CN111858099A (en) 2020-10-30
CN111858099B CN111858099B (en) 2024-05-28

Family

ID=72949630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010725994.9A Active CN111858099B (en) 2020-07-24 2020-07-24 Message subscription method and device

Country Status (1)

Country Link
CN (1) CN111858099B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259424A (en) * 2021-04-29 2021-08-13 西安点告网络科技有限公司 Cross-regional data transmission method and system
CN113452603A (en) * 2021-06-28 2021-09-28 青岛海尔科技有限公司 Data transmission method and related device
CN115685816A (en) * 2022-10-13 2023-02-03 江苏联宏智慧能源股份有限公司 An Energy Data Subscription and Control System Based on Websocket

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662486A (en) * 2008-08-30 2010-03-03 华为技术有限公司 Method and system for subscribing information
CN102857406A (en) * 2012-07-23 2013-01-02 大唐移动通信设备有限公司 Message processing method and device for JBM (Java message service) system
US20140067940A1 (en) * 2012-08-31 2014-03-06 Facebook, Inc. Subscription groups in publish-subscribe system
US9509529B1 (en) * 2012-10-16 2016-11-29 Solace Systems, Inc. Assured messaging system with differentiated real time traffic
US20170187642A1 (en) * 2015-12-23 2017-06-29 Intel Corporation Managing communication congestion for internet of things devices
CN107634929A (en) * 2016-07-18 2018-01-26 中兴通讯股份有限公司 Method for processing business and device
CN110121863A (en) * 2016-09-23 2019-08-13 萨托里环球有限责任公司 For providing the system and method for message to multiple subscribers
WO2019205371A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server, message allocation method, and storage medium
CN111343289A (en) * 2020-05-22 2020-06-26 苏宁智能终端有限公司 MQTT protocol-based message pushing method and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662486A (en) * 2008-08-30 2010-03-03 华为技术有限公司 Method and system for subscribing information
CN102857406A (en) * 2012-07-23 2013-01-02 大唐移动通信设备有限公司 Message processing method and device for JBM (Java message service) system
US20140067940A1 (en) * 2012-08-31 2014-03-06 Facebook, Inc. Subscription groups in publish-subscribe system
US9509529B1 (en) * 2012-10-16 2016-11-29 Solace Systems, Inc. Assured messaging system with differentiated real time traffic
US20170187642A1 (en) * 2015-12-23 2017-06-29 Intel Corporation Managing communication congestion for internet of things devices
CN107634929A (en) * 2016-07-18 2018-01-26 中兴通讯股份有限公司 Method for processing business and device
CN110121863A (en) * 2016-09-23 2019-08-13 萨托里环球有限责任公司 For providing the system and method for message to multiple subscribers
WO2019205371A1 (en) * 2018-04-24 2019-10-31 平安科技(深圳)有限公司 Server, message allocation method, and storage medium
CN111343289A (en) * 2020-05-22 2020-06-26 苏宁智能终端有限公司 MQTT protocol-based message pushing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
雷宝龙;葛以踊;: "基于发布订阅模式的消息转发服务设计", 江苏科技信息, no. 22, 30 November 2013 (2013-11-30), pages 62 - 63 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259424A (en) * 2021-04-29 2021-08-13 西安点告网络科技有限公司 Cross-regional data transmission method and system
CN113452603A (en) * 2021-06-28 2021-09-28 青岛海尔科技有限公司 Data transmission method and related device
CN115685816A (en) * 2022-10-13 2023-02-03 江苏联宏智慧能源股份有限公司 An Energy Data Subscription and Control System Based on Websocket

Also Published As

Publication number Publication date
CN111858099B (en) 2024-05-28

Similar Documents

Publication Publication Date Title
CN111858099B (en) Message subscription method and device
CN108124003B (en) Network management equipment connection processing method, device and system
CN112039722B (en) A kind of MQTT protocol simulation method and simulation device
JP2013539267A (en) Method and apparatus for reducing data transmission overhead
US10467161B2 (en) Dynamically-tuned interrupt moderation
CN112579316A (en) Method, apparatus and computer program product for information processing
CN110557458A (en) Method and device for remotely controlling entertainment terminal and 5G self-service bank entertainment system
CN105975351A (en) User behavior message reporting method and apparatus
CN111954031B (en) Method and system for dynamically adjusting frame extraction rate of video stream
WO2012155440A1 (en) Method and apparatus for processing service request based on hyper text transfer protocol
CN111949521A (en) Software performance testing method and device
CN111131499A (en) Concurrent and asynchronous task processing method and device thereof
CN112995347A (en) Method, device, equipment and storage medium for realizing end-to-end real-time data display
CN102356609A (en) Flow control method of switched network and device
CN103118339B (en) Speaking right application method, network equipment and terminal equipment
CN113395671B (en) Message pushing rate adjusting method and device and server
EP1744557A1 (en) Method and device for shaping the service flow transmitted in network
CN114416275A (en) Method and system for synchronizing virtual machine states by multiple management clients
CN118368249B (en) Congestion control method, device, equipment, medium and product
CN107231401B (en) Session monitoring method, device and system
CN113328906A (en) Flow real-time monitoring method and device, storage medium and electronic equipment
CN113055292A (en) Method for improving forwarding performance of multi-core router and multi-core router
WO2013189421A2 (en) Distributed call ticket statistical method, device and system
CN118803044A (en) Reverse proxy method based on RDMA, and data transmission method of reverse proxy end
US10862811B1 (en) Message brokering for asynchronous status updates

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant