MULTIPLE-SPEED MESSAGE CHANNEL OF MESSAGING SYSTEM
Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for storing messages of a channel of a plurality of channels in one or more buffers, determining, a respective sampling rate for one or more connections based at least in part on a determined latency of each connection, receiving a request for messages of the channel from a subscriber through a connection of the one or more connections, selecting messages from the one or more buffers according to the sampling rate, and sending the selected messages to the subscriber using the connection.
1 . A method, comprising:
storing messages of a channel of a plurality of channels in one or more buffers;
determining, by one or more computer processors, a respective sampling rate for one or more connections based at least in part on a determined latency of each connection;
receiving a request for messages of the channel from a subscriber through a connection of the one or more connections;
selecting messages from the one or more buffers according to the sampling rate; and
sending the selected messages to the subscriber using the connection.
2 . The method of claim 1 , further comprising:
receiving the messages of the channel from a plurality of publishers.
3 . The method of claim 1 , wherein the messages of the channel are stored in the one or more buffers according to an order.
4 . The method of claim 3 , wherein the order comprises the order in which messages of the channel are received.
5 . The method of claim 1 , wherein the selected messages are sent to the subscriber according to an order.
6 . The method of claim 1 , further comprising:
determining the latency of the connection based on an indication of at least one of a delay and a missing delivery to the subscriber of one or more messages of the channel.
7 . The method of claim 1 , further comprising:
determining the latency of the connection based on an indication of at least one of a delay and a missing delivery to the subscriber of one or more messages of another channel of the plurality of channels.
8 . The method of claim 1 , further comprising:
determining a second latency of the connection; and
adjusting the sampling rate for the connection based on the second latency.
9 . The method of claim 1 , wherein each buffer comprises a respective time-to-live.
10 . The method of claim 9 , wherein the messages are selected from the one or more buffers that have not expired.
11 . A system, comprising:
one or more computer processors programmed to:
store messages of a channel of a plurality of channels in one or more buffers;
determine a respective sampling rate for one or more connections based at least in part on a determined latency of each connection;
receive a request for messages of the channel from a subscriber through a connection of the one or more connections;
select messages from the one or more buffers according to the sampling rate; and
send the selected messages to the subscriber using the connection.
12 . The system of claim 11 , wherein the one or more computer processors are further programmed to:
receive the messages of the channel from a plurality of publishers.
13 . The system of claim 11 , wherein the messages of the channel are stored in the one or more buffers according to an order.
14 . The method of claim 13 , wherein the order comprises the order in which messages of the channel are received.
15 . The method of claim 1 , wherein the selected messages are sent to the subscriber according to an order.
16 . The system of claim 11 , wherein the one or more computer processors are further programmed to:
determine the latency of the connection based on an indication of at least one of a delay and a missing delivery to the subscriber of one or more messages of the channel.
17 . The system of claim 11 , wherein the one or more computer processors are further programmed to:
determine the latency of the connection based on an indication of at least one of a delay and a missing delivery to the subscriber of one or more messages of another channel of the plurality of channels.
18 . The system of claim 11 , wherein the one or more computer processors are further programmed to:
determine a second latency of the connection; and
adjust the sampling rate for the connection based on the second latency.
19 . The system of claim 11 , wherein each buffer comprises a respective time-to-live.
20 . A non-transitory computer-readable medium having instructions stored thereon that, when executed by one or more computer processors, cause the one or more computer processors to:
store messages of a channel of a plurality of channels in one or more buffers;
determine a respective sampling rate for one or more connections based at least in part on a determined latency of each connection;
receive a request for messages of the channel from a subscriber through a connection of the one or more connections;
select messages from the one or more buffers according to the sampling rate; and
send the selected messages to the subscriber using the connection.