[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104811459A - Processing method, processing device and system for message services and message service system - Google Patents

Processing method, processing device and system for message services and message service system Download PDF

Info

Publication number
CN104811459A
CN104811459A CN201410032412.3A CN201410032412A CN104811459A CN 104811459 A CN104811459 A CN 104811459A CN 201410032412 A CN201410032412 A CN 201410032412A CN 104811459 A CN104811459 A CN 104811459A
Authority
CN
China
Prior art keywords
message
connection
client
receiving
server
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.)
Pending
Application number
CN201410032412.3A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410032412.3A priority Critical patent/CN104811459A/en
Publication of CN104811459A publication Critical patent/CN104811459A/en
Priority to HK15109593.5A priority patent/HK1208970A1/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/224Monitoring or handling of messages providing notification on incoming messages, e.g. pushed notifications of received messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a message processing method and message processing device for message publishing and subscription, and a message management method and a message management device for message publishing and subscription. The invention further provides a system for message services and a message service system. The message processing method for message publishing comprises the steps of receiving a message published by a client; establishing connection with a message management server, and forwarding the message published by the client to the message management server; and sending a response for successful publishing to the client after processing of the message management server. The method and the device provided by the invention can realize separation of a message connection function and a message management function, thereby being capable of realizing message publishing with high reliability and low cost.

Description

Processing method, device and system for message service and message service system
Technical Field
The present application relates to the field of message service technologies, and in particular, to a message processing method for message publishing, a message processing method for message subscribing, and a device thereof. The application also relates to a message management method for message publishing, a message management method for message subscribing and a system thereof, and a message service system.
Background
With the rapid development of cloud computing, more and more distributed applications are built and deployed in a cloud environment, and most of the distributed applications adopt a message system-based architecture. In a conventional message service system, the message queue middleware is a core component of the system, which typically assumes two core functions: respectively connection management and message management. Namely, not only the function of managing the connection for receiving and transmitting messages but also the function of managing messages for receiving or transmitting messages. However, the message middleware with the above function division may cause the server to be crushed under the pressure of massive connection, and at this time, the message middleware message management function is also affected.
To support a large number of connections, one has to rely on adding more message queue servers, although sometimes the load of a large number of connections may not be high (a large number of connections may only need to be maintained, the amount of data it transfers may not be large). Similarly, the large number of messages to be managed may also affect the performance of the server, resulting in the inability to establish a new connection. Therefore, the traditional message service system has the problems of mutual coupling of functions, high cost and resource waste.
In order to solve the problem of the coupling of the functions of the message service system and the high cost, the industry adopts the following optimization scheme aiming at the problem: by using the idea of 'read-write separation', the two functions of sending messages and receiving messages are separated (or separated into two roles of producers and consumers), so that the messages fall to different servers of the message queue cluster.
Features of the messaging function: it is usually a short connection, i.e. initiates a connection to the message queue server, sends a message, closes the connection. The characteristics of the function of receiving messages are as follows: it is a long connection, i.e. a connection that is initiated and maintained to the message queue server, and when a message is received at the server end, the message is delivered to the connection, from which it is consumed and processed.
The two functions of sending and receiving messages are separated to different servers, in fact, the short connection and the long connection are separated to different servers, and through the separation, the servers can be respectively added when needed, so that some physical resources can be saved.
Separating the two functions of sending and receiving messages to different servers is actually a solution that is not a permanent solution, and if the pressure is continuously increased, more servers are still needed to deal with the pressure, and the problems of function coupling and high cost cannot be really solved.
Content of application
The present application provides a message processing method and device for message publishing and subscribing, and a message management method and device for message publishing and subscribing, so as to solve the above-mentioned problems of the existing message service system and method. The application further provides a system for message service and a message service system.
The application provides a message processing method for message publishing, which comprises the following steps:
receiving a message issued by a client;
establishing connection with a message management server, and forwarding the message issued by the client to the message management server;
and sending a response of successful publication to the client after the processing of the message management server.
Optionally, before receiving the message issued by the client, a connection with the client is established.
Optionally, the establishing the connection with the client includes:
receiving a connection request initiated by a client in a TCP protocol,
responding the connection request to the client and requesting the client to confirm;
and receiving the confirmation returned by the client and establishing the connection with the client.
Optionally, the connection is a short connection based on a hypertext protocol.
Optionally, the establishing a connection with the message management server, and forwarding the message issued by the client to the message management server includes:
establishing a connection with a message management server, and establishing a virtual communication channel based on the connection;
and issuing the message to the message management server through the virtual communication channel.
Optionally, the establishing a connection with the message management server, and establishing a virtual communication channel based on the connection includes:
selecting any one connection from a connection pool which is established in advance and connected with the message management server;
a virtual communication channel based on the connection is selected in the selected connection.
Optionally, the connection with the message management server is a long connection.
Optionally, the receiving the message issued by the client specifically refers to selecting a message issued by a receiving client in a receiving end cluster formed by a plurality of receiving ends;
the establishing of the connection with the client specifically includes:
acquiring the load condition and health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the sending, to the client after the processing of the message management server, a response that the publication is successful includes:
receiving a response message which is sent by a message management server and has stored a message;
and sending a response of successful release to the client after receiving the response message.
In addition, the present application also provides a message processing method for message subscription, including:
receiving a request for subscribing a message sent by a client, and establishing connection with the client;
establishing a virtual communication channel to a message management server for the connection;
receiving a subscribed message through the virtual communication channel;
delivering the received subscribed message to a client;
and sending a confirmation response that the message is consumed to the message management server after the client consumes the message.
Optionally, the receiving a request for subscribing to a message sent by a client, where the connection established between clients includes:
receiving a websocket handshake request initiated by a client;
sending a response based on the websocket handshake request to a client;
a request sent by a client to begin consuming a message is received.
Optionally, the establishing a virtual communication channel to the message management server for the connection includes:
selecting any one connection from a connection pool which is established in advance and connected with the message management server;
a virtual communication channel based on the connection is selected in the selected connection.
Optionally, the receiving of the request for subscribing to the message sent by the client specifically refers to selecting a request for receiving the subscription message sent by the client in a receiving end cluster formed by a plurality of receiving ends;
the establishing of the connection with the client specifically includes:
acquiring the load condition and health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the sending a confirmation response that the message is consumed to the message management server after the client consumes the message includes:
receiving a confirmation that a message sent by a client has been consumed;
a confirmation response is sent to the message management server that the message was consumed based on the confirmation sent by the client.
In addition, the present application also provides a message management method for message publishing, including:
receiving a request for establishing connection sent by a message connection server, and establishing connection with the message connection server;
receiving and storing a message to be issued forwarded by a message connection server;
and sending a response that the message to be issued confirms the reception to a message connection server.
In addition, the present application also provides a message management method for message subscription, including:
receiving a request for establishing connection sent by a message connection server, and establishing connection with the message connection server;
delivering the subscribed message to a message connection server through the connection;
receiving a confirmation response that the message sent by the message connection server is consumed;
and deleting the consumed message and the backup thereof according to the confirmation response.
In addition, the application also provides a message processing device for message publishing, which comprises
A message receiving unit to be issued, which is used for receiving the message issued by the client;
the message forwarding unit to be issued is used for establishing connection with the message management server and forwarding the message issued by the client to the message management server;
and the release state feedback unit is used for sending a response of successful release to the client after the processing of the message management server.
Optionally, the apparatus further comprises a control unit,
and the connection unit is used for establishing connection with the client before receiving the message issued by the client.
Optionally, the connection unit is specifically configured to establish a short connection based on a hypertext protocol with the client before receiving the message issued by the client.
Optionally, the to-be-issued message forwarding unit includes:
a connection and virtual channel establishing unit for establishing a connection with the message management server and establishing a virtual communication channel based on the connection;
and the forwarding unit is used for issuing the message to the message management server through the virtual communication channel.
Optionally, the connection and virtual channel establishing unit includes:
a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server;
a virtual channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
Optionally, the to-be-issued message receiving unit is specifically configured to select a message issued by a receiving client from a receiving end cluster formed by multiple receiving ends;
the connection unit includes:
the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the release status feedback unit includes:
the release state receiving unit is used for receiving a response message which is sent by the message management server and stored in the message;
and the release state forwarding unit is used for sending a response of successful release to the client after receiving the response message.
In addition, the present application also provides a message processing apparatus for message subscription, including:
a subscription request receiving unit, configured to receive a request for subscribing to a message sent by a client, and establish a connection between the clients;
a virtual channel establishing unit for establishing a virtual communication channel to the message management server for the connection;
a subscription message receiving unit, configured to receive a subscribed message through the virtual communication channel;
a subscription message delivery unit, configured to deliver the received subscribed message to a client;
and the consumption state feedback unit is used for sending a confirmation response that the message is consumed to the message management server after the client consumes the message.
Optionally, the subscription requesting unit includes:
the handshake request receiving unit is used for receiving a websocket handshake request initiated by a client;
the response unit is used for sending a response based on the websocket handshake request to the client;
and the request receiving unit is used for receiving a request of starting the consumption message sent by the client.
Optionally, the virtual channel establishing unit includes:
a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server;
a channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
Optionally, the subscription request receiving unit is specifically configured to select, from a receiving end cluster formed by multiple receiving ends, a request for receiving a subscription message sent by a client;
the subscription request receiving unit further includes:
the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the consumption state feedback unit includes:
the consumption state receiving unit is used for receiving the confirmation that the message sent by the client is consumed;
and the consumption state forwarding unit is used for sending a confirmation response that the message is consumed to the message management server based on the confirmation sent by the client.
In addition, the present application also provides a message management apparatus for message publishing, including:
the connection establishing unit is used for receiving a request for establishing connection sent by the message connection server and establishing connection with the message connection server;
the message processing unit is used for receiving and storing the message to be issued forwarded by the message connection server;
and the processing feedback unit is used for sending a response that the message to be issued is confirmed to be received to the message connection server.
In addition, the present application also provides a message management apparatus for message subscription, including:
the connection establishing unit is used for receiving a request for establishing connection sent by the message connection server and establishing connection with the message connection server;
the message delivery unit is used for delivering the subscribed message to the message connection server through the connection;
a confirmation response receiving unit for receiving a confirmation response that the message transmitted by the message connection server is consumed;
and the deleting unit is used for deleting the consumed message and the backup thereof according to the confirmation response.
In addition, the present application also provides a system for a message service, which includes:
a message connection server, including any one of the above-mentioned message processing devices for message publishing and/or any one of the above-mentioned message processing devices for message subscription;
the message management service device comprises the message management device for message publishing and/or the message management device for message subscription.
In addition, the present application also provides a message service system, including:
a client;
the message is connected with the server cluster; and a message management server cluster;
any message connection server of the message connection server cluster comprises any message processing device for message publishing and/or any message processing device for message subscription;
any message connection server of the message management server cluster comprises the message management device for message publishing and/or the message management device for message subscription.
Compared with the prior art, the method has the following advantages:
the application provides a message processing method for message publishing, and particularly relates to a method for message connection and forwarding in message publishing, which receives a message to be published by a client by establishing a connection with the client, forwards the message to a message management server by establishing a connection with a message processing server, and further confirms that the message management server successfully receives and stores the message through a confirmation mechanism. The method only relates to the forwarding and connection of the message issuing, but not to the management of the message, and separates the message management function to the message management server, thereby realizing the separation of the connection function and the management function. Therefore, the message distribution with high reliability and low cost can be realized, the balanced distribution of the message connection is realized through load balancing, the connection can be expanded according to the actual connection requirement, and the high horizontal expansion capability is realized;
in addition, the application also provides a message processing method for message subscription, and in particular, a message connection and delivery forwarding method for message subscription, which forwards a message delivered by a message management server by establishing a connection with a client, and receives the message delivered by the message management server by establishing a connection channel with the message management server, and further confirms that the client has successfully consumed the message through a confirmation mechanism. Compared with the message processing mode for message publishing, the method of the embodiment only relates to message delivery forwarding and connection, but not to management of the message, and separates the message management function to the message management server to realize separation of the connection function and the management function. Therefore, the message subscription with high reliability and low cost can be realized, the balanced distribution of the message connection is realized through load balancing, the connection can be expanded according to the actual connection requirement, and the high horizontal expansion capability is realized.
Drawings
FIG. 1 is a flow diagram of an embodiment of a message processing method for message publishing in the present application;
FIG. 2 is a schematic diagram of an embodiment of a message processing apparatus for message publishing according to the present application;
FIG. 3 is a flowchart of an embodiment of a message management method for message publishing according to the present application;
FIG. 4 is a diagram of an embodiment of a message management apparatus for message distribution according to the present application;
FIG. 5 is a flowchart of an embodiment of a message processing method for message subscription according to the present application;
FIG. 6 is a schematic diagram of an embodiment of a message processing apparatus for message delivery according to the present application;
FIG. 7 is a flowchart of an embodiment of a message management method for message subscription according to the present application;
FIG. 8 is a diagram illustrating an embodiment of a message management apparatus for message subscription according to the present application;
FIG. 9 is a schematic diagram of an embodiment of a system for a message server of the present application;
fig. 10 is a schematic diagram of an embodiment of a system for a message server of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
As described above, in the conventional message service system and method, the problems of function coupling and excessive cost of the conventional message service system and method are solved by the concept of "read-write separation". That is, two types of functions of sending and receiving messages are separated to different servers, and then a sending message server and a receiving message server are added as required. However, in essence, both the sending message server and the receiving message server have to perform the dual functions of connection and message management, the problem of mismatch between the message service connection and the message management load still cannot be solved, and the problem of functional coupling between different types of message servers still exists, so that the problem of too high success of the message server is also not solved.
Based on this, the present application provides a new message service system and method, and the core idea is to separate the message service connection function and the message management function in the message service system and method to different servers for execution. The message connection server is specially used for connection management, and the message management server is specially used for message management; the message connection server is responsible for the connection of the clients, which are the message producer and consumer, with the message management server and the forwarding of the messages. The message management server is responsible for message management such as message storage, backup, queue and delivery, and the message management server is not directly connected with the client and is only connected with the message connection server. According to the message service connection and message management load conditions, a message connection server and a message management server can be added respectively to form a message connection server cluster and a message management server cluster. The connection function and the management function are separated to different types of servers, so that the separation of the connection management function and the message management function is realized, and the connection service and the message processing service are separated from different servers and cannot be influenced mutually. In addition, the connection server and the message management server can be configured according to needs, the requirements of connection and message management are met, and cost is saved.
Embodiments of methods and apparatuses for use in a message connection service and a message management service are described in detail below based on the message service system and method of the present application described above, respectively. Further, in the following description, methods and apparatuses in a message connection and message management service will be described with respect to message publishing and message subscribing processes, respectively.
In the following embodiments, embodiments of a method and apparatus for a message connectivity service for message publishing are first described. Please refer to fig. 1, which illustrates a message processing method for message publishing in this embodiment.
In this embodiment, an embodiment of a message processing method for message publishing includes the following steps:
step S100, receiving the message issued by the client.
Because message passing has the advantages of being platform independent, supporting concurrent and asynchronous calls, and the like, compared with other information interaction modes such as remote call, file passing, and the like, more and more distributed applications adopt an architecture based on a message system. A message is essentially a data structure containing data that can be recognized by both the consumer and the service, which needs to be passed between different processes and may be consumed by a number of disparate clients. As described above, in many distributed technologies, a non-blocking calling feature is adopted for message-based processing, a message is sent to a message server, the message server forwards the message to a recipient at an appropriate time, the sending and receiving are asynchronous, the sender does not need to wait, the life cycles of the message server and the recipient do not need to be the same, and the sender can indirectly send the message to multiple recipients, thereby greatly improving the performance, expandability and robustness of the program. And the message processing described above can be implemented through message middleware.
The message middleware utilizes an efficient and reliable message transfer mechanism for platform-independent data communication and integration of a distributed system based on data communication. By providing a messaging and message queuing model, it can extend inter-process communication in a distributed environment. Message middleware is suitable for distributed environments where reliable data transfer is required. In the system adopting the message middleware mechanism, different objects activate the event of the other side by transmitting messages, and the corresponding operation is completed. The sender sends the message to the message server, and the message server stores the message in a plurality of queues and forwards the message to the receiver when appropriate. Message middleware, which is often used to mask features between various platforms and protocols, enables collaboration between applications, provides synchronous and asynchronous connections between clients and servers, and can deliver or store-and-forward messages at any time.
As described above, the message-based architecture is adopted in the distributed system, and the producer of the message and the subscriber of the message are referred to as clients in the present embodiment. In this embodiment, the client (client) is an application program for establishing a connection for the purpose of issuing a request, and a carrier storing the application program is also generally referred to as a client, and the two are not distinguished in this application. The server (server) is an application program that accepts a connection and responds to a service request by sending a response, and the carrier storing the application program is also referred to as a server, which is not distinguished in the present application. That is, any given program (or carrier containing the program) has the ability to act as both a client and a server, and we use the relevant concepts not to see if it functionally implements a client and a server, but what role (client or server) it plays over a particular connection period.
Different from the prior art, in this embodiment, the message producer produces the message and then sends the message to the message connection server in this embodiment instead of transferring the message to the message middleware in the prior art. The message connection server receives the message produced by the client.
Before the message connection server of this embodiment receives a message sent by a client, it first establishes a connection with the client. The connection may be a long connection or a short connection. The long connection means that the connection is maintained after the communication connection of the system, the short connection means that the connection is established only when the system sends messages to each other, the connection is closed after the request message is responded, and the short connection is generally initiated by the client. The communication entities use long connection, generally need to define heartbeat message, periodically send to detect whether the link between systems is abnormal (called polling), send a heartbeat at regular intervals, if the heartbeat message is not received for a certain number of times, this considers that the connection has problems, and needs to be disconnected and reestablished. The format of the specific heartbeat message, the sending interval, the number of times of receiving no heartbeat, the link is considered to be abnormal, and whether the data part counts as the heartbeat message (if some systems receive the data packet, the heartbeat timer is cleared, which is equivalent to that the data packet in the systems also counts as the heartbeat message); this requires negotiation at both ends.
In the message publishing, at the beginning of the message publishing, the connection needs to be established, and once the message publishing is finished, the connection can be closed, and the short connection is applicable. The above-mentioned long connection is more suitable for message subscription, but the above-mentioned polling method for establishing long connection has many disadvantages, and the following embodiments of the message processing method for message subscription will be discussed, and will not be described herein again.
As described above, in the message processing for message publishing in this embodiment, the connection established with the client is generally a short connection, and one of the ways of establishing connection is as follows: receiving a connection request initiated by a client through a hypertext connection protocol, responding the connection request to the client, and establishing connection. Specifically, the connection mode between the message connection server and the client may be an HTTP connection.
HTTP is an abbreviation of Hyper Text Transfer Protocol. Its development is a series of request for Revision (RFC) publications collaborated by the World Wide Web Consortium and the Internet working group IETF (Internet engineering Task force), RFC1945 defining the HTTP/version 1.0. RFC 2616 defines a version of HTTP1.1, which is currently in widespread use. The HTTP protocol is a transfer protocol for transferring hypertext from a WWW server to a local browser. It can make the browser more efficient, make the network transmission reduce. It not only ensures that a computer transmits a hypertext document correctly and quickly, but also determines which part of the transmitted document and which part of the content is displayed first (e.g., text before graphics), etc. HTTP is an application layer protocol, consisting of requests and responses, and is a standard client server model. The HTTP protocol is typically carried over the TCP protocol, and sometimes over the TLS or SSL protocol layers, the latter being HTTPs.
The connection based on the HTTP protocol is that the client side initiates a request and the server returns a response. That is, it cannot be realized that the server pushes the message to the client when the client does not initiate a request. In addition, the HTTP protocol is also a stateless protocol, and the current request and the last request of the same client have no correspondence.
The HTTP protocol-based connection (connection) is actually a physical loop of the transport layer, which is established between two communicating applications. In the above description, a request (request) message from the client to the server includes a method for the resource, an identifier of the resource, and a version number. A response (response) returned from the server includes the version number of the HTTP protocol, the status of the request (e.g., "successful" or "confirmed" or "not found", etc.), and the MIME type of the document.
HTTP-based connections are typically short connections, however, in HTTP1.1, they also support long connections. Specifically, in HTTP 1.1-based, a connection header may be present in both the request and response headers. The implication of this connection is how long connections are handled when communicating between the client and the server. In HTTP1.1, both the client and the server support long connections by default, and if the long connections are not desired to be used, the connection value needs to be set to close (close) in the connection head; if the server-side does not want to support long connections either, it is necessary to explicitly state the value of connection as off in the response. The value of the connector in both the request and the response is set to be closed, which indicates that the connection between the server and the client is broken after the request is processed. In this embodiment, when a short connection is required between the client and the message connection server, the value of the connection head in the request and the response may be set to close when the connection is established between the client and the message connection server.
In addition, the connection between the client and the server can also adopt a TCP connection or a socket connection. The typical TCP connection is generally implemented by three handshakes, and the flow is as follows: the client sends a connection request to the server, which is the first step of three-way handshake; then, the server responds to the connection request initiated by the client and requires confirmation, which is the second step of the three-way handshake; the client then responds with a confirmation of the server that the connection was successful, which is the third step of the three-way handshake. The process of the handshake does not contain data, and the client starts to formally transmit data after the three-way handshake is finished. Ideally, once a TCP connection is established, the TCP connection is maintained until either party actively closes the connection. When the connection is disconnected, the server and the client can both actively initiate the disconnection request. The disconnection process requires a "four-way handshake", i.e., one more interaction to determine disconnection than the connection process described above. And will not be described in detail herein.
Socket is a basic unit of operation for network communication that supports the TCP/IP protocol. When the application layer performs data communication through the transport layer, TCP may encounter a problem of providing concurrent services for multiple applications at the same time, and multiple TCP connections or multiple application processes may need to transmit data through the same TCP protocol port. To distinguish between different application processes and threads, the operating system provides a socket interface for applications to interact with the TCP/IP protocol. At least one pair of sockets is needed for establishing Socket connection, wherein one Socket runs on a client and is called a Clientsocket, and the other Socket runs on a server and is called a Serversocket. The connection process between the sockets is divided into three steps, namely server monitoring, client request and connection confirmation. Once the connection is confirmed, both parties have established a connection. In general, a Socket connection is a TCP connection.
As described above, the TCP connection or Socket connection is a long connection in terms of network technology. However, since the TCP connection may request to close after the data transmission is completed, it may also be considered that the connection processing only one request or processing one data per connection is a short connection in the service level, and correspondingly, the connection may be called a long connection waiting for processing the next data without disconnecting the connection after the connection is established and the service is processed. The short connection in the present application refers to both a short connection in the technical plane and a short connection in the service plane. That is to say, in this embodiment, the connection between the client and the server may also adopt the above-mentioned TCP connection or socket connection.
In summary, when receiving a message issued by a client, a connection between the client and a server (specifically, a message connection server in this application) needs to be established, which is usually a short connection, and after the message is received, the connection between the client and the server can be disconnected. The short connection typically comprises an HTTP connection, a TCP connection or a Socket connection. However, it should be noted that, in this embodiment, the selection of the short connection between the client and the server is only a preferred connection manner from the viewpoint of saving bandwidth resources and server resources, and does not mean that the short connection must be implemented between the client and the server. Establishing a long connection between the two also achieves the purpose of receiving messages issued by the client. This will not be described further herein.
As described above, in a distributed system where connection needs to be large, a plurality of message connection servers are required to form a server cluster. When the connection with the client is established, the load conditions and the health conditions of a plurality of message connection servers can be calculated through a load balancing algorithm, and then which message connection server is connected with the client is determined to receive the message. The server load balancing algorithm has various algorithms, including round robin algorithm, minimum connection algorithm, response time algorithm, hash algorithm, minimum connection error algorithm, link bandwidth algorithm and the like. The load balancing solution comprises a software implementation and a hardware implementation, wherein the software implementation realizes load balancing by installing one or more accessory software in a server; the hardware implementation is that load balancing equipment is directly installed between the server and the external network, the equipment is generally called as a load balancer, because the load balancer is independent of an operating system and is executed by special equipment, the overall performance is greatly improved, and the optimal load balancing requirement can be met by matching with diversified load balancing strategies and intelligent flow management. Through the load balancing algorithm and the load balancer, the following advantages can be brought to the system: 1. the pressure is negative, namely, the connection request can be evenly forwarded to the back-end message connection server according to the load condition of the message connection server; 2. horizontal expansion, namely a plurality of servers in the background can work as a whole, the message connection servers can be dynamically increased to support pressure, better performance is provided, and meanwhile, the redundancy and reliability of a loosely-coupled system can be realized; 3. and in the health monitoring process, the load balancer can continuously monitor the health condition of the back-end message connection server, and once a message connection server in a background goes down, the load balancer can automatically remove the server from the forwarding candidate server list, so that the client cannot feel that the server goes down, and the system is not influenced to the maximum extent.
After the connection with the client is established, the message issued by the client can be received, the received flow comprises the step that the client sends a message sending request again, after the message management server confirms the message sending request, the message can be sent based on the established connection, the step flow of sending the message has no difference from the flow of receiving the message by the existing message middleware, and the details are not repeated herein. After the message management server receives the message, the short connection between the client and the message connection server is closed.
Step S110, establishing a connection with the message management server, and forwarding the message issued by the client to the message management server.
As described above, after receiving a message issued by a client, the message connection server needs to forward the message to the message management server, and the message management server performs management operations such as storage, redundancy backup, and message queue establishment. Before forwarding a message, a connection with a message management server needs to be established, a virtual communication channel is established based on the connection, and the message is issued to the message management server through the virtual communication channel. The connection between the message connection server and the message management server can be established in the above manner, but in order to improve efficiency and save resources and overhead, the connection between the message connection server and the message management server can be realized in the following manner: any connection is selected from a connection pool of connections between pre-established message management servers, and a virtual communication channel (also called a connection channel) based on the connection is selected from the selected connections as a channel for message forwarding.
As described above, establishing a connection to a server basically needs to go through the following process: establishing a physical channel, performing primary handshake with the server, and performing authentication … on the connection by the server; the process is time-consuming and labor-consuming, frequent connection establishment occupies resources of the server, and processing of other transactions is seriously influenced. Specifically, when the message connection server needs to forward a message, it first selects a connection from the connection pool according to the connection request, and selects a virtual communication channel based on the connection. If the connections in the connection pool are all used up, adding a new connection into the connection pool, and selecting the new connection; if the connection pool has a limit on the maximum number of connections, the connection request enters a wait queue until a connection is available, which also means that after a connection is used up, the connection should be released so that the connection can be returned to the connection pool for reuse, and the connections in the connection pool are all long connections. After the connection is established, the message to be issued is forwarded to the message management server for processing through the connection channel.
Establishing connections through the connection pools has the following advantages: 1. the connection of the connection pool is reusable, so that resources are saved and the expenditure is reduced; 2. the connections in the connection pool are all long connections, so that transactions can be processed more quickly; 3. the connections in the connection pool each enable a plurality of virtual communication channels, each of which may exchange data with the message queue cluster as a communication stream.
Step S120, after the processing of the message management server, the response of successful distribution is sent to the client.
After receiving the message forwarded by the message connection server, the message management server sends a message (acknowledgement ack) confirming the receipt to the message connection server after processing the message, such as storage, redundancy backup, and the like. The message connection server sends a response of successful message distribution to the client after receiving the message, and the response can also be issued in a message form, which is not described herein again.
In the method of the embodiment, a connection with a client is established to receive a message to be published by the client, and the message is forwarded to a message management server by establishing a connection with a message processing server, and further, the message management server is confirmed to successfully receive and store the message through a confirmation mechanism. The method only relates to the forwarding and connection of the message issuing, but not to the management of the message, and separates the message management function to the message management server, thereby realizing the separation of the connection function and the management function. Therefore, the method can realize the message distribution with high reliability and low cost, realize the balanced distribution of the message connection through load balance, expand the connection according to the actual connection requirement and have high horizontal expansion capability.
Corresponding to the message processing method for message publishing, the application also provides a message processing device for message publishing. Please refer to fig. 2, which is a schematic diagram of an embodiment of a message processing apparatus for message publishing according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An embodiment of a message processing apparatus for message publishing provided by the present application includes a to-be-published message receiving unit 200, configured to receive a message published by a client; a to-be-published message forwarding unit 210, configured to establish a connection with a message management server, and forward a message published by the client to the message management server; and a publishing state feedback unit 220, configured to send a response that the publishing is successful to the client after the processing of the message management server.
Optionally, the apparatus further includes a connection unit, configured to establish a connection with the client before receiving the message issued by the client.
Optionally, the connection unit is specifically configured to establish a short connection based on a hypertext protocol with the client before receiving the message issued by the client.
Optionally, the to-be-issued message forwarding unit includes: a connection and virtual channel establishing unit for establishing a connection with the message management server and establishing a virtual communication channel based on the connection; and the forwarding unit is used for issuing the message to the message management server through the virtual communication channel.
Optionally, the connection and virtual channel establishing unit includes: a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server; a virtual channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
Optionally, the to-be-issued message receiving unit is specifically configured to select a message issued by a receiving client from a receiving end cluster formed by multiple receiving ends; the connection unit includes: the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm; and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the release status feedback unit includes: the release state receiving unit is used for receiving a response message which is sent by the message management server and stored in the message; and the release state forwarding unit is used for sending a response of successful release to the client after receiving the response message.
In addition, the present application also provides a message management method for message publishing, please refer to fig. 3, which is a flowchart of an embodiment of the message management method for message publishing according to the present application. In this embodiment, the message management method includes:
step S300, receiving a request for establishing connection sent by a message connection server, and establishing connection with the message connection server; this step corresponds to the connection request initiated by the message connection server in the message processing method for message sending described above, and as described above, the connection is a long connection, and may be established directly, or may be established by selecting a connection through a connection pool, and a message is sent through a virtual communication channel based on the connection. This will not be described in detail here.
Step S310, receiving and storing the message to be issued forwarded by the message connection server.
After establishing connection with the message connection server, the message management server receives the message issued by the message connection server, stores the message in the message management server, and performs redundancy backup. The message is persistent and redundant, so that the message data is more reliable.
In addition, the message management server also undertakes message queue establishment. In addition, the message management server can form a server cluster to avoid single point of failure.
Step S320, sending a response that the to-be-published message has confirmed to be received to the message connection server.
After receiving and storing the message, sending an acknowledgement ack to the message connection server, ensuring reliable transmission of the message and avoiding that the message is lost and can not be known in the forwarding process.
With reference to fig. 4, it is a schematic diagram of an embodiment of a message management apparatus for message publishing according to the present application. The message management apparatus includes: a connection establishing unit 400, configured to receive a request for establishing a connection sent by a message connection server, and establish a connection with the message connection server; the message processing unit 410 is configured to receive and store a message to be published forwarded by the message connection server; and a processing feedback unit 420, configured to send a response that the to-be-issued message is confirmed to be received to the message connection server.
In addition, the present application also provides a message processing method for message subscription, please refer to fig. 5, which is a flowchart of a message processing method for message subscription according to this embodiment. In this embodiment, the message processing method for message subscription includes the following steps:
step S500, receiving a request for subscribing the message sent by the client, and establishing connection with the client.
When the message is required to be subscribed, the client sends out a request for subscribing the message and requests to establish a connection channel with the message connection server so as to forward the message delivered by the message management server.
The connection established in this step with the client is a long connection, and the establishment mode may adopt the TCP connection or socket connection establishment process in the above-described message processing method for message publishing, or a long connection establishment process based on the HTTP1.1 protocol. And will not be described in detail herein. However, the above-mentioned connection is mostly a long connection established based on a polling method, and as mentioned above, the long connection established in this way occupies large resources. In this embodiment, a websocket-based connection method is preferably used, and the connection establishment process is as follows: receiving a websocket handshake request initiated by a client; sending a response based on the websocket handshake request to a client; a request sent by a client to begin consuming a message is received. Specifically, the WebSocket protocol is essentially a TCP-based protocol. In order to establish a WebSocket connection, a client browser firstly initiates an HTTP request to a server, the request is different from a common HTTP request and comprises some additional header information, wherein the additional header information 'Upgrade: WebSocket' indicates that the request is an HTTP request for protocol upgrading, the server analyzes the additional header information and then generates response information to be returned to the client, the WebSocket connection between the client and the server is established, the client and the server can freely transmit information through the connection channel, and the connection can continuously exist until the client or one of the server actively closes the connection. That is to say, the client and the server can establish connection only by one-time handshake in the websocket mode, polling is not needed, and data can be sent at any time during the connection establishment.
It should be noted that, in this embodiment, the websocket is taken as an example to describe establishing a connection between the message connection server and the client, but the method is not limited to this, and any long connection that can be used for message forwarding and delivery may be applied to this.
Step S510, a virtual communication channel to the message management server is established for the connection.
After establishing a connection with a client and receiving a request for consuming a message, establishing a virtual communication channel to a message management server for the connection, wherein the establishment mode of the virtual communication channel is not different from the mode of selecting the connection through the connection pool and selecting the virtual communication channel based on the connection, and the mode is not repeated herein.
In addition, in an environment with a large connection demand, the message connection servers may also form a connection server cluster, and the pressure balance distribution of the connection is realized through a load balancing algorithm, and for further information on the pressure balance of the connection of the load balancing realization server, reference may be made to the above-mentioned description of the message processing method for message publishing.
Step S520, receiving subscribed information through the virtual communication channel;
after the virtual communication channel for message delivery is established, when a subscribed message queue has a message, the message management server (also called a message queue server) delivers the message to the message connection server through the established virtual communication channel. And the message connection server receives the message delivered by the message connection server.
Step S530, delivering the received subscribed message to a client;
after receiving the delivered message, the delivered message is forwarded to the client through the established long connection with the client.
Step S540, after the client consumes the message, sends a confirmation response that the message is consumed to the message management server. After receiving and consuming the message, the client sends a message consumption confirmation message to the message management server, and the message management server sends a message consumption confirmation response to the message management server after receiving the message.
In the method of the embodiment, a connection with a client is established to forward a message delivered by a message management server, a connection channel with the message management server is established to receive the message delivered by the message management server, and a confirmation mechanism is further used to confirm that the client has successfully consumed the message. Compared with the message processing mode for message publishing, the method of the embodiment only relates to message delivery forwarding and connection, but not to management of the message, and separates the message management function to the message management server to realize separation of the connection function and the management function. Therefore, the message subscription with high reliability and low cost can be realized, the balanced distribution of the message connection is realized through load balancing, the connection can be expanded according to the actual connection requirement, and the high horizontal expansion capability is realized.
Corresponding to the message processing method for message subscription, the application also provides a message processing device for message subscription. Please refer to fig. 6, which is a schematic diagram of an embodiment of a message processing apparatus for message delivery according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
A message processing apparatus for subscribing to a message provided in this embodiment includes: a subscription request receiving unit 600, configured to receive a request for subscribing to a message sent by a client, and establish a connection between the clients; a virtual channel establishing unit 610, configured to establish a virtual communication channel to the message management server for the connection; a subscription message receiving unit 620, configured to receive a subscribed message through the virtual communication channel; a subscribed message delivery unit 630, configured to deliver the received subscribed message to a client; and a consumption state feedback unit 640, configured to send a confirmation response that the message is consumed to the message management server after the client consumes the message.
Optionally, the subscription requesting unit includes: the handshake request receiving unit is used for receiving a websocket handshake request initiated by a client; the response unit is used for sending a response based on the websocket handshake request to the client; and the request receiving unit is used for receiving a request of starting the consumption message sent by the client.
Optionally, the virtual channel establishing unit includes: a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server; a channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
Optionally, the subscription request receiving unit is specifically configured to select, from a receiving end cluster formed by multiple receiving ends, a request for receiving a subscription message sent by a client; the subscription request receiving unit further includes: the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm; and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
Optionally, the consumption state feedback unit includes: the consumption state receiving unit is used for receiving the confirmation that the message sent by the client is consumed; and the consumption state forwarding unit is used for sending a confirmation response that the message is consumed to the message management server based on the confirmation sent by the client.
In addition, the present application also provides a message management method for message subscription, please refer to fig. 7, which is a flowchart of an embodiment of the message management method for message subscription according to the present application, in the embodiment, the message management method includes:
step S700, receiving a request for establishing a connection sent by the message connection server, and establishing a connection with the message connection server. This step corresponds to the connection request initiated by the message connection server in the message processing method for unsubscribing described above, and as described above, the connection is a long connection, and may be established directly, or may be established by selecting a connection through a connection pool, and a message is sent through a virtual communication channel based on the connection. This will not be described in detail here.
Step S710, delivering subscribed information to the information connection server through the connection;
step S720, receiving a confirmation response that the message sent by the message connection server is consumed;
and step S730, deleting the consumed message and the backup thereof according to the confirmation response.
With reference to fig. 8, it is a schematic diagram of an embodiment of a message management apparatus for message subscription according to the present application. The message management apparatus includes: a connection establishing unit 800, configured to receive a request for establishing a connection sent by a message connection server, and establish a connection with the message connection server; a message delivery unit 810 for delivering the subscribed message to the message connection server through the connection; an acknowledgement response receiving unit 820 for receiving an acknowledgement response that the message transmitted by the message connection server is consumed; and a deleting unit 830, configured to delete the consumed message and the backup thereof according to the confirmation response.
Fig. 9 is a schematic diagram of an embodiment of a system for a message server according to the present application, the system includes a message connection server 900 and a message management server 910, where the message connection server 900 includes any one of the above-mentioned devices for message processing and/or any one of the above-mentioned devices for message subscription processing;
the message management service device 910 includes any of the above message management devices for message publishing and/or any of the above message management devices for message subscribing.
That is, the message connection server of the present application may integrate a processing device for message publishing and a message processing device for message subscription, both of which essentially establish a connection between the client and the message management server and forward the message therebetween.
In addition, the present application also provides a system of a message service, please refer to fig. 10, which is a schematic diagram of an embodiment of the system for a message server of the present application, and the system of the message service includes: a client 1001; the message connects the server cluster 1002; and a message management server cluster 1003; wherein,
any message connection server of the message connection server cluster 1002 comprises any of the above-mentioned message processing apparatuses for message publishing and/or any of the above-mentioned message processing apparatuses for message subscription; any message connection server of the message management server cluster 1003 comprises any message management device for message publishing described above and/or any message management device for message subscription described above. Furthermore, the golden balance distribution of the connection between the client and the message connection server can be realized through a load balancer.
In the message service system of this embodiment, the message connection and the message management are separated and executed on the message connection server cluster and the message management server cluster, the message connection server in the message connection server cluster only implements connection and message forwarding between the client and the message management server, and the message management server in the message management server cluster is only used for implementing storage and queue management of messages. The distributed message service system effectively solves the problem that the cost of message connection and message management resources is not matched, can pointedly expand the message connection server cluster and the message management server cluster, does not waste the server resources on the basis of meeting the requirements of message connection and message management, and has the advantages of high reliability, strong expandability and high utilization rate, thereby reducing the cost.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.

Claims (32)

1. A message processing method for message publishing, comprising:
receiving a message issued by a client;
establishing connection with a message management server, and forwarding the message issued by the client to the message management server;
and sending a response of successful publication to the client after the processing of the message management server.
2. The message processing method for message distribution according to claim 1, wherein the connection with the client is established before the message distributed by the client is received.
3. The message processing method for message publishing according to claim 1, wherein the establishing a connection with the client comprises:
receiving a connection request initiated by a client in a TCP (transmission control protocol);
responding the connection request to the client and requesting the client to confirm;
and receiving the confirmation returned by the client and establishing the connection with the client.
4. The message processing method for message distribution as recited in claim 1, wherein the connection is a short hypertext protocol based connection.
5. The message processing method for message publishing according to claim 1, wherein the establishing of the connection with the message management server and the forwarding of the message published by the client to the message management server comprises:
establishing a connection with a message management server, and establishing a virtual communication channel based on the connection;
and issuing the message to the message management server through the virtual communication channel.
6. The message processing method for message distribution according to claim 5, wherein the establishing a connection with the message management server and the establishing a virtual communication channel based on the connection comprises:
selecting any one connection from a connection pool which is established in advance and connected with the message management server;
a virtual communication channel based on the connection is selected in the selected connection.
7. The message processing method for message distribution according to claim 6, wherein the connection with the message management server is a long connection.
8. The message processing method for message distribution according to claim 2, wherein the message distributed by the receiving client specifically refers to a message distributed by a receiving client selected from a receiving end cluster formed by a plurality of receiving ends;
the establishing of the connection with the client specifically includes:
acquiring the load condition and health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
9. The message processing method for message publishing according to claim 1, wherein the sending a response to the client that the publishing was successful after the message management server processing comprises:
receiving a response message which is sent by a message management server and has stored a message;
and sending a response of successful release to the client after receiving the response message.
10. A message processing method for message subscription, comprising:
receiving a request for subscribing a message sent by a client, and establishing connection with the client;
establishing a virtual communication channel to a message management server for the connection;
receiving a subscribed message through the virtual communication channel;
delivering the received subscribed message to a client;
and sending a confirmation response that the message is consumed to the message management server after the client consumes the message.
11. The message processing method for message subscription according to claim 10, wherein said receiving a request for subscribing to a message from a client, establishing a connection between clients comprises:
receiving a websocket handshake request initiated by a client;
sending a response based on the websocket handshake request to a client;
a request sent by a client to begin consuming a message is received.
12. The message processing method for message subscription as claimed in claim 10, wherein the establishing a virtual communication channel to a message management server for the connection comprises:
selecting any one connection from a connection pool which is established in advance and connected with the message management server;
a virtual communication channel based on the connection is selected in the selected connection.
13. The message processing method for message subscription according to claim 10, wherein the request for receiving the subscription message sent by the client specifically refers to a request for selecting a receiving client to send the subscription message in a receiving end cluster composed of a plurality of receiving ends;
the establishing of the connection with the client specifically includes:
acquiring the load condition and health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
14. The message processing method for message subscription according to claim 10, wherein said sending a confirmation response that the message was consumed to the message management server after the client consumed the message comprises:
receiving a confirmation that a message sent by a client has been consumed;
a confirmation response is sent to the message management server that the message was consumed based on the confirmation sent by the client.
15. A message management method for message publishing, comprising:
receiving a request for establishing connection sent by a message connection server, and establishing connection with the message connection server;
receiving and storing a message to be issued forwarded by a message connection server;
and sending a response that the message to be issued confirms the reception to a message connection server.
16. A message management method for message subscription, comprising:
receiving a request for establishing connection sent by a message connection server, and establishing connection with the message connection server;
delivering the subscribed message to a message connection server through the connection;
receiving a confirmation response that the message sent by the message connection server is consumed;
and deleting the consumed message and the backup thereof according to the confirmation response.
17. A message processing apparatus for message distribution, comprising
A message receiving unit to be issued, which is used for receiving the message issued by the client;
the message forwarding unit to be issued is used for establishing connection with the message management server and forwarding the message issued by the client to the message management server;
and the release state feedback unit is used for sending a response of successful release to the client after the processing of the message management server.
18. The message processing apparatus for message distribution according to claim 17, wherein said apparatus further comprises,
and the connection unit is used for establishing connection with the client before receiving the message issued by the client.
19. The message processing apparatus for message publishing according to claim 18, wherein the connection unit is specifically configured to establish a short hypertext protocol based connection with the client before receiving the message published by the client.
20. The message processing apparatus for message publishing according to claim 17, wherein the to-be-published message forwarding unit comprises:
a connection and virtual channel establishing unit for establishing a connection with the message management server and establishing a virtual communication channel based on the connection;
and the forwarding unit is used for issuing the message to the message management server through the virtual communication channel.
21. The message processing apparatus for message distribution according to claim 20, wherein the connection and virtual channel establishing unit comprises:
a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server;
a virtual channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
22. The message processing apparatus according to claim 17, wherein the message to be published receiving unit is specifically configured to select a message published by a receiving client from a receiving end cluster formed by a plurality of receiving ends;
the connection unit includes:
the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
23. The message processing apparatus for message distribution according to claim 17, wherein the distribution status feedback unit comprises:
the release state receiving unit is used for receiving a response message which is sent by the message management server and stored in the message;
and the release state forwarding unit is used for sending a response of successful release to the client after receiving the response message.
24. A message processing apparatus for message subscription, comprising:
a subscription request receiving unit, configured to receive a request for subscribing to a message sent by a client, and establish a connection between the clients;
a virtual channel establishing unit for establishing a virtual communication channel to the message management server for the connection;
a subscription message receiving unit, configured to receive a subscribed message through the virtual communication channel;
a subscription message delivery unit, configured to deliver the received subscribed message to a client;
and the consumption state feedback unit is used for sending a confirmation response that the message is consumed to the message management server after the client consumes the message.
25. The message processing apparatus for message subscription according to claim 24, wherein the subscription requesting unit comprises:
the handshake request receiving unit is used for receiving a websocket handshake request initiated by a client;
the response unit is used for sending a response based on the websocket handshake request to the client;
and the request receiving unit is used for receiving a request of starting the consumption message sent by the client.
26. The message processing apparatus for message subscription according to claim 24, wherein the virtual channel establishing unit comprises:
a connection selection unit for selecting any one connection from a connection pool established in advance and connected with the message management server;
a channel selection unit for selecting a virtual communication channel based on the connection among the selected connections.
27. The message processing apparatus for message subscription according to claim 24, wherein the subscription request receiving unit is specifically configured to select, in a receiving end cluster composed of a plurality of receiving ends, a request for receiving a subscription message sent by a client;
the subscription request receiving unit further includes:
the load balancing unit is used for obtaining the load condition and the health condition of each receiving end in the receiving end cluster through a load balancing algorithm;
and the connection execution unit is used for establishing the connection between the corresponding receiving end and the client according to the load condition and the health condition and the principle that the pressure is negative.
28. The message processing apparatus for message subscription according to claim 24, wherein the consumption state feedback unit comprises:
the consumption state receiving unit is used for receiving the confirmation that the message sent by the client is consumed;
and the consumption state forwarding unit is used for sending a confirmation response that the message is consumed to the message management server based on the confirmation sent by the client.
29. A message management apparatus for message distribution, comprising:
the connection establishing unit is used for receiving a request for establishing connection sent by the message connection server and establishing connection with the message connection server;
the message processing unit is used for receiving and storing the message to be issued forwarded by the message connection server;
and the processing feedback unit is used for sending a response that the message to be issued is confirmed to be received to the message connection server.
30. A message management apparatus for message subscription, comprising:
the connection establishing unit is used for receiving a request for establishing connection sent by the message connection server and establishing connection with the message connection server;
the message delivery unit is used for delivering the subscribed message to the message connection server through the connection;
a confirmation response receiving unit for receiving a confirmation response that the message transmitted by the message connection server is consumed;
and the deleting unit is used for deleting the consumed message and the backup thereof according to the confirmation response.
31. A system for message service, comprising:
a message connection server comprising a message processing apparatus for message publishing according to any one of claims 17 to 23 and/or a message processing apparatus for message subscription according to any one of claims 24 to 28;
message management service means comprising message management means for message publishing according to claim 29 and/or message management means for message subscribing according to claim 30.
32. A message service system, comprising:
a client;
the message is connected with the server cluster; and a message management server cluster;
any message connection server of the message connection server cluster comprises the message processing device for message publishing of any of the above claims 16 to 21 and/or the message processing device for message subscription of any of the above claims 22 to 25;
any message connection server of the message management server cluster comprises the message management device for message publishing according to claim 26 above and/or the message management device for message subscription according to claim 27 above.
CN201410032412.3A 2014-01-23 2014-01-23 Processing method, processing device and system for message services and message service system Pending CN104811459A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410032412.3A CN104811459A (en) 2014-01-23 2014-01-23 Processing method, processing device and system for message services and message service system
HK15109593.5A HK1208970A1 (en) 2014-01-23 2015-09-30 Processing method, device and system for message service and message service system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410032412.3A CN104811459A (en) 2014-01-23 2014-01-23 Processing method, processing device and system for message services and message service system

Publications (1)

Publication Number Publication Date
CN104811459A true CN104811459A (en) 2015-07-29

Family

ID=53695951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410032412.3A Pending CN104811459A (en) 2014-01-23 2014-01-23 Processing method, processing device and system for message services and message service system

Country Status (2)

Country Link
CN (1) CN104811459A (en)
HK (1) HK1208970A1 (en)

Cited By (41)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105119927A (en) * 2015-09-07 2015-12-02 北京百度网讯科技有限公司 Message sending, receiving method and terminal and message sending system
CN105306350A (en) * 2015-12-01 2016-02-03 深圳市乐唯科技开发有限公司 Message interaction method, device and system
CN105681462A (en) * 2016-03-14 2016-06-15 南京邮电大学 Cluster system based on message router, and data communication transfer method
CN105827503A (en) * 2015-11-18 2016-08-03 广东亿迅科技有限公司 Enterprise circle message management system and method
CN105868011A (en) * 2016-03-29 2016-08-17 上海斐讯数据通信技术有限公司 Method and device for improving running efficiency of software system
CN105933217A (en) * 2016-07-14 2016-09-07 北京元心科技有限公司 Message synchronization method and platform, network server and adaptive server
CN106209966A (en) * 2016-06-15 2016-12-07 中国科学院信息工程研究所 Management and control end updates the method for equipment state, the treating method and apparatus of service end
CN106254390A (en) * 2016-09-22 2016-12-21 曙光信息产业(北京)有限公司 Information push method and system
CN106302817A (en) * 2016-09-29 2017-01-04 南京中新赛克科技有限责任公司 A kind of data/address bus implementation method based on Distributed Message Queue and device
CN106375447A (en) * 2016-09-05 2017-02-01 深圳前海微众银行股份有限公司 Service switching method and device based on message middleware
CN106384290A (en) * 2016-08-31 2017-02-08 泰康保险集团股份有限公司 Insurance policy processing system, method and device
CN106534107A (en) * 2016-11-04 2017-03-22 北方工业大学 Internet of Things message service system
CN106603270A (en) * 2016-11-10 2017-04-26 广州酷狗计算机科技有限公司 Tracking method and device for invoked link in distributed system
CN106648922A (en) * 2016-10-11 2017-05-10 江苏电力信息技术有限公司 Data collecting method based on XMPP
CN106657349A (en) * 2016-12-29 2017-05-10 上海理想信息产业(集团)有限公司 Message subscription processing device, system and method
CN106685915A (en) * 2016-10-28 2017-05-17 努比亚技术有限公司 Method of safety communication of mobile terminal and server, server and mobile terminal
CN106686091A (en) * 2016-12-30 2017-05-17 广州尚融网络科技有限公司 Virtual channel control method and system
CN106878415A (en) * 2017-02-15 2017-06-20 阿里巴巴集团控股有限公司 The load-balancing method and device of data consumption
CN106961482A (en) * 2017-04-01 2017-07-18 联想(北京)有限公司 A kind of information processing method and device, storage medium, electronic equipment
CN106961410A (en) * 2016-01-08 2017-07-18 阿里巴巴集团控股有限公司 A kind of abnormal access detection method and device
CN107370663A (en) * 2017-07-03 2017-11-21 中国南方电网有限责任公司 A kind of browser instant messaging services distributed deployment method
CN107483327A (en) * 2017-09-05 2017-12-15 江苏电力信息技术有限公司 A kind of instant communication method based on long Connection Service independent
CN108124003A (en) * 2017-12-11 2018-06-05 中盈优创资讯科技有限公司 Network management device connection processing method, apparatus and system
CN108156223A (en) * 2017-12-06 2018-06-12 深圳市猫投鹰信息科技有限公司 A kind of accurate supplying system of message based on websocket and method
CN108173917A (en) * 2017-12-22 2018-06-15 杭州顺网珑腾信息技术有限公司 A kind of Internet chatroom message repeater system of distribution no maximum
CN108282507A (en) * 2017-01-06 2018-07-13 阿里巴巴集团控股有限公司 The method, apparatus and electronic equipment using publication are carried out in CaaS environment
CN109344172A (en) * 2018-08-31 2019-02-15 深圳市元征科技股份有限公司 A kind of high concurrent data processing method, device and client-server
CN110098987A (en) * 2019-04-19 2019-08-06 一起住好房(北京)网络科技有限公司 A method of solving the long connection load balancing of Internet of Things multilayer
CN110290139A (en) * 2019-06-28 2019-09-27 苏州思必驰信息科技有限公司 Method for message transmission and device
CN110324642A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
CN110647575A (en) * 2018-06-08 2020-01-03 成都信息工程大学 Distributed heterogeneous processing framework construction method and system
CN110928704A (en) * 2018-09-20 2020-03-27 广州虎牙信息科技有限公司 Message processing method, message processing system, server, and computer storage medium
CN111381981A (en) * 2020-03-04 2020-07-07 上海东普信息科技有限公司 Method, device and equipment for pushing applet messages and storage medium
CN111586140A (en) * 2020-04-30 2020-08-25 深圳市优必选科技股份有限公司 Data interaction method and server
CN111614752A (en) * 2020-05-19 2020-09-01 北京百度网讯科技有限公司 Method and device for data transmission
CN111901176A (en) * 2020-08-03 2020-11-06 京信通信系统(中国)有限公司 Fault determination method, device, equipment and storage medium
CN112134783A (en) * 2020-08-11 2020-12-25 广州市贺氏办公设备有限公司 Instant messaging system, method, device and medium based on user intimacy
CN112291224A (en) * 2020-10-23 2021-01-29 上海淇玥信息技术有限公司 Real-time communication interaction method and device and electronic equipment
CN112351068A (en) * 2020-09-29 2021-02-09 苏宁云计算有限公司 Information synchronization method, system, device, computer equipment and storage medium
CN113726836A (en) * 2020-11-16 2021-11-30 北京沃东天骏信息技术有限公司 Information response method, device, equipment and computer readable medium
CN115550432A (en) * 2022-10-27 2022-12-30 浪潮云信息技术股份公司 Method and system for subscribing and pushing dynamic data

Cited By (59)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105119927A (en) * 2015-09-07 2015-12-02 北京百度网讯科技有限公司 Message sending, receiving method and terminal and message sending system
CN105827503A (en) * 2015-11-18 2016-08-03 广东亿迅科技有限公司 Enterprise circle message management system and method
CN105827503B (en) * 2015-11-18 2019-03-19 广东亿迅科技有限公司 A kind of enterprise circle message management system and method
CN105306350A (en) * 2015-12-01 2016-02-03 深圳市乐唯科技开发有限公司 Message interaction method, device and system
CN106961410B (en) * 2016-01-08 2020-02-18 阿里巴巴集团控股有限公司 Abnormal access detection method and device
CN106961410A (en) * 2016-01-08 2017-07-18 阿里巴巴集团控股有限公司 A kind of abnormal access detection method and device
CN105681462A (en) * 2016-03-14 2016-06-15 南京邮电大学 Cluster system based on message router, and data communication transfer method
CN105681462B (en) * 2016-03-14 2019-03-01 南京邮电大学 It is a kind of based on message routing group system and data communication in shifting method
CN105868011A (en) * 2016-03-29 2016-08-17 上海斐讯数据通信技术有限公司 Method and device for improving running efficiency of software system
CN106209966A (en) * 2016-06-15 2016-12-07 中国科学院信息工程研究所 Management and control end updates the method for equipment state, the treating method and apparatus of service end
CN105933217B (en) * 2016-07-14 2019-11-08 北京元心科技有限公司 Message synchronization method and platform, network server and adaptive server
CN105933217A (en) * 2016-07-14 2016-09-07 北京元心科技有限公司 Message synchronization method and platform, network server and adaptive server
CN106384290A (en) * 2016-08-31 2017-02-08 泰康保险集团股份有限公司 Insurance policy processing system, method and device
CN106384290B (en) * 2016-08-31 2020-05-12 泰康保险集团股份有限公司 Policy processing system, method and device
CN106375447A (en) * 2016-09-05 2017-02-01 深圳前海微众银行股份有限公司 Service switching method and device based on message middleware
CN106375447B (en) * 2016-09-05 2020-02-07 深圳前海微众银行股份有限公司 Service switching method and device based on message middleware
CN106254390A (en) * 2016-09-22 2016-12-21 曙光信息产业(北京)有限公司 Information push method and system
CN106302817A (en) * 2016-09-29 2017-01-04 南京中新赛克科技有限责任公司 A kind of data/address bus implementation method based on Distributed Message Queue and device
CN106648922A (en) * 2016-10-11 2017-05-10 江苏电力信息技术有限公司 Data collecting method based on XMPP
CN106685915A (en) * 2016-10-28 2017-05-17 努比亚技术有限公司 Method of safety communication of mobile terminal and server, server and mobile terminal
CN106534107B (en) * 2016-11-04 2020-05-12 北方工业大学 Message service system of Internet of things
CN106534107A (en) * 2016-11-04 2017-03-22 北方工业大学 Internet of Things message service system
CN106603270A (en) * 2016-11-10 2017-04-26 广州酷狗计算机科技有限公司 Tracking method and device for invoked link in distributed system
CN106657349A (en) * 2016-12-29 2017-05-10 上海理想信息产业(集团)有限公司 Message subscription processing device, system and method
CN106686091A (en) * 2016-12-30 2017-05-17 广州尚融网络科技有限公司 Virtual channel control method and system
CN108282507B (en) * 2017-01-06 2021-02-02 阿里巴巴集团控股有限公司 Method and device for application release in CaaS environment and electronic equipment
CN108282507A (en) * 2017-01-06 2018-07-13 阿里巴巴集团控股有限公司 The method, apparatus and electronic equipment using publication are carried out in CaaS environment
CN106878415A (en) * 2017-02-15 2017-06-20 阿里巴巴集团控股有限公司 The load-balancing method and device of data consumption
CN106878415B (en) * 2017-02-15 2020-09-01 阿里巴巴集团控股有限公司 Load balancing method and device for data consumption
CN106961482A (en) * 2017-04-01 2017-07-18 联想(北京)有限公司 A kind of information processing method and device, storage medium, electronic equipment
CN106961482B (en) * 2017-04-01 2021-01-15 联想(北京)有限公司 Information processing method and device, storage medium and electronic equipment
CN107370663A (en) * 2017-07-03 2017-11-21 中国南方电网有限责任公司 A kind of browser instant messaging services distributed deployment method
CN107483327A (en) * 2017-09-05 2017-12-15 江苏电力信息技术有限公司 A kind of instant communication method based on long Connection Service independent
CN108156223A (en) * 2017-12-06 2018-06-12 深圳市猫投鹰信息科技有限公司 A kind of accurate supplying system of message based on websocket and method
CN108124003A (en) * 2017-12-11 2018-06-05 中盈优创资讯科技有限公司 Network management device connection processing method, apparatus and system
CN108124003B (en) * 2017-12-11 2021-03-26 中盈优创资讯科技有限公司 Network management equipment connection processing method, device and system
CN108173917A (en) * 2017-12-22 2018-06-15 杭州顺网珑腾信息技术有限公司 A kind of Internet chatroom message repeater system of distribution no maximum
CN110324642B (en) * 2018-03-30 2021-07-23 武汉斗鱼网络科技有限公司 Bullet screen server connection method, client and readable storage medium
CN110324642A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
CN110647575A (en) * 2018-06-08 2020-01-03 成都信息工程大学 Distributed heterogeneous processing framework construction method and system
CN110647575B (en) * 2018-06-08 2022-03-11 成都信息工程大学 Distributed heterogeneous processing framework construction method and system
CN109344172A (en) * 2018-08-31 2019-02-15 深圳市元征科技股份有限公司 A kind of high concurrent data processing method, device and client-server
CN109344172B (en) * 2018-08-31 2022-05-17 深圳市元征科技股份有限公司 High-concurrency data processing method and device and client server
CN110928704A (en) * 2018-09-20 2020-03-27 广州虎牙信息科技有限公司 Message processing method, message processing system, server, and computer storage medium
CN110098987B (en) * 2019-04-19 2021-05-28 一起住好房(北京)网络科技有限公司 Method for balancing multilayer long connection load of Internet of things
CN110098987A (en) * 2019-04-19 2019-08-06 一起住好房(北京)网络科技有限公司 A method of solving the long connection load balancing of Internet of Things multilayer
CN110290139B (en) * 2019-06-28 2021-12-31 思必驰科技股份有限公司 Message transmission method and device
CN110290139A (en) * 2019-06-28 2019-09-27 苏州思必驰信息科技有限公司 Method for message transmission and device
CN111381981A (en) * 2020-03-04 2020-07-07 上海东普信息科技有限公司 Method, device and equipment for pushing applet messages and storage medium
CN111381981B (en) * 2020-03-04 2023-07-11 上海东普信息科技有限公司 Method, device, equipment and storage medium for pushing small program message
CN111586140A (en) * 2020-04-30 2020-08-25 深圳市优必选科技股份有限公司 Data interaction method and server
CN111614752A (en) * 2020-05-19 2020-09-01 北京百度网讯科技有限公司 Method and device for data transmission
CN111901176A (en) * 2020-08-03 2020-11-06 京信通信系统(中国)有限公司 Fault determination method, device, equipment and storage medium
CN112134783A (en) * 2020-08-11 2020-12-25 广州市贺氏办公设备有限公司 Instant messaging system, method, device and medium based on user intimacy
CN112351068A (en) * 2020-09-29 2021-02-09 苏宁云计算有限公司 Information synchronization method, system, device, computer equipment and storage medium
CN112291224A (en) * 2020-10-23 2021-01-29 上海淇玥信息技术有限公司 Real-time communication interaction method and device and electronic equipment
CN112291224B (en) * 2020-10-23 2023-11-24 上海淇玥信息技术有限公司 Interaction method and device for real-time communication and electronic equipment
CN113726836A (en) * 2020-11-16 2021-11-30 北京沃东天骏信息技术有限公司 Information response method, device, equipment and computer readable medium
CN115550432A (en) * 2022-10-27 2022-12-30 浪潮云信息技术股份公司 Method and system for subscribing and pushing dynamic data

Also Published As

Publication number Publication date
HK1208970A1 (en) 2016-03-18

Similar Documents

Publication Publication Date Title
CN104811459A (en) Processing method, processing device and system for message services and message service system
CN111565229B (en) Communication system distributed method based on Redis
US20180270310A1 (en) Method for transport agnostic communication between internet of things client and broker
CN110661871B (en) Data transmission method and MQTT server
JP2012095098A (en) Data communication method and information processor
CN107528891B (en) Websocket-based automatic clustering method and system
US10958712B2 (en) Enhanced reliability for information services
US10834033B2 (en) Method and system for transferring messages between messaging systems
US10574518B2 (en) Method and apparatus of performing remote management of a managed machine
CN102957623B (en) A kind of maintaining method of neighborhood of border gate protocol and equipment
CN116048538B (en) Service grid deployment method and device for DPU
CN107645517A (en) Data push method and device
US20080208959A1 (en) Hanging request system and method for client/server communication
CN103312558B (en) In computer clients server system, network is connected with validity monitoring method and system
US20140201376A1 (en) Method and system for the handling of redundant long poll
CN113542324B (en) Message pushing method and device
CN105188087A (en) Business communication method and system based on short message gateway
CN116192863B (en) Micro-service flow processing method, DPU service grid deployment method and system
CN109379443B (en) Method for realizing distributed message queue facing to Internet of things
CN113904860A (en) Data transmission method, device, equipment, system and storage medium
CN105516097A (en) Mixed-architecture message system and message transmission method based on Thrift data format
CN113037803A (en) Geological disaster monitoring method and system, electronic equipment and storage medium
US10044835B1 (en) Reducing redundant transmissions by polling clients
CN108686373B (en) Message lock processing method and device
CN114095759B (en) Stream media redirection method and related device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1208970

Country of ref document: HK

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150729

REG Reference to a national code

Ref country code: HK

Ref legal event code: WD

Ref document number: 1208970

Country of ref document: HK