US20220365978A1 - Managing query subscription renewals in a messaging platform - Google Patents
Managing query subscription renewals in a messaging platform Download PDFInfo
- Publication number
- US20220365978A1 US20220365978A1 US17/815,010 US202217815010A US2022365978A1 US 20220365978 A1 US20220365978 A1 US 20220365978A1 US 202217815010 A US202217815010 A US 202217815010A US 2022365978 A1 US2022365978 A1 US 2022365978A1
- Authority
- US
- United States
- Prior art keywords
- response
- event
- subscription
- query
- message
- 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.)
- Abandoned
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/9032—Query formulation
- G06F16/90324—Query formulation using system suggestions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
- H04L51/046—Interoperability with other network applications or services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/214—Monitoring or handling of messages using selective forwarding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/52—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/216—Handling conversation history, e.g. grouping of messages in sessions or threads
Definitions
- a social media messaging platform may facilitate the exchange of millions or hundreds of millions of social media messages among its users.
- the messages exchanged on the platform often can provide users of the platform the latest update or reporting on current events.
- a user may submit a search on the platform and receive a stream of results such that the user can view messages over time that match one or more keywords.
- matching messages in a very large message stream over a period of time while rendering those messages to the user in real-time involve complex and technique technical challenges such as processing speed, computer resource allocation, and security issues.
- This disclosure relates to streaming real-time messages over time to client applications according to query subscriptions that match content from a large stream of messages exchanged on a messaging platform in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number of active query subscriptions, and/or increases the security of matching the query subscriptions against messages generated from the perspective of the authors while delivering those messages in real-time from the perspective of the users that initiated the query subscriptions.
- the client application may generate and send a query subscription request (e.g., a GraphQL subscription query), over a network to a subscription executor (e.g., a GraphQL engine) of the messaging platform to cause the subscription executor to generate a query subscription and provide the query subscription to an event producer system of the messaging platform.
- a query subscription request e.g., a GraphQL subscription query
- a subscription executor e.g., a GraphQL engine
- the client application may generate and send a subscribe request to a transport engine to create a delivery channel between the client application and the transport engine. The messages matched by the event producer system may be streamed to the client application via the delivery channel.
- the management of query subscriptions is separated from the delivery of messages by using two separate modules, e.g., the subscription executor, the transport engine, which may increase the speed of delivery from query creation to the matching and then rendering of real-time messages to the client.
- two subscriptions are generated (e.g., one at the subscription executor, and one at the transport engine)
- this may suggest that the client application would have to renew at both the subscription executor and the transport module.
- the client application may renew with the transport engine, and the structure of the messaging platform may cause the query subscription to be renewed at the transport engine and the subscription executor, thereby decreasing the amount of communication transmitted between the client application and the messaging platform to maintain the query subscription.
- the messaging platform may be capable of executing query subscriptions from thousands of client applications against a large message stream (e.g., over 50 k messages per second) and delivering tens of thousands of messages per second to the client applications.
- the user may not be required to refresh the user interface or submit another request view new messages on the user interface, but rather the messages are pushed to the user interface of the user in response to other users posting messages on the messaging platform that match the query subscription.
- the user may enter a search term such as “dog” to generate an active query, and then receive a stream of messages that include the search term “dog” and continue to receive messages that include the search term “dog” as new messages are created and posted to the messaging platform until the active query expires.
- the user may continue to view matched content after the submission of the active query (and until the active query expires).
- the event producer system includes an event producer manager and a plurality of event producers configured to simultaneously execute query subscriptions to identifying matching content.
- the event producer manager receives a query subscription from the subscription executor and assigns the query subscription to one or more event producers such that the query subscription is stored at the assigned event producer.
- the event producer manager may manage the configuration of the event producers, e.g., causing the storage and removal of query subscriptions, to control the computing resources at the event producer system. For example, the event producer manager may remove expired (or faulty) query subscriptions from the event producers and assign new query subscriptions as they are received at the event producer manager.
- the assigned event producer generates a response event in response to a message from a message queue matching the query subscription. The response event may identify the message having content that is matched with the query subscription.
- the subscription executor receives the response events, generates the messages identified by the response events with data from the perspective of the user that initiated the query subscription, and provides the messages to the transport engine to be delivered via the delivery channel. For example, the messages in the message queue have been generated from the perspective of their authors. However, the messages delivered to the client applications may be required to have data from the perspective of the users that initiated the requests.
- the subscription executor may generate the messages (e.g., hydrate and apply visibility rules to the messages) after they have been matched by the event producer system but before delivery by the transport engine. In this manner, if an author of a matched message has restricted (e.g., blocked or muted) the user that initiated the query subscription, the subscription executor may discard that message, thereby increasing the security of the messaging platform.
- the response event may only include the data that the user had requested for the subscription, the amount of data published on an event bus may be decreased, causing no extra data sent to the client which may help save bandwidth to stream more events per second.
- the event producers may be grouped into a plurality of event producer groups, where each event producer group receives the full message stream.
- Each producer group includes a plurality of event producers, where each event producer receives a separate portion of the full message stream.
- Each event producer group is allocated a separate portion of the query subscriptions.
- the event producer manager may assign a subscription query to an event producer group, where each event producer in the group stores and executes the query subscription.
- the event producer manager may assign a subscription to a first event producer group and a second event producer group such that the query subscription can be maintained if there is an error at processing the query subscription at one of the event producer groups.
- the system can easily control the amount of responses at the event producer system by increasing or decreasing the number of event producer groups and/or increasing or decreasing the number of event producers in each group to account for the fluctuating amount of query subscriptions and response events. For instance, in response to the number of event producers in a single event producer group being increased, each individual event producer may receive fewer messages from the message stream to process and consequently may have more computational capacity to handle extra searches. In response to the number of event producer groups being increased, the number of search terms allocated to the event producer may be reduced.
- the event producer system includes a collector service that receives the response events from the event producers and discards one or more response events to control a streaming rate such that the messages identified by the response events are streamed to the client application in a manner that is equal to or below a streaming rate threshold. For example, if the messages are streamed at a fast rate, the user may not be able to consume the streamed messages. As such, the collector service may throttle the streaming rate so that the rate at which the messages are streamed is equal to or less than a threshold level. For example, if the streaming rate threshold is 10 messages per second, the collector service may discard response events over 10 within a one second time interval.
- the collector service may discard messages based on other attributes besides the time of when the response events are generated. For example, the collector service may discard messages predicated as low quality or abusive to provide the messages at a streaming rate that is less than the threshold. In some example, the collector service may discard messages that are predicted to have low engagements to provide the messages at a streaming rate that is less than the threshold.
- the collector service receives status responses from the event producers and stores the status responses in a memory cache.
- the collector service may determine a health of the query subscription by periodically querying the memory cache for the status responses. If the collector service determines that the query subscription is repairable, the collector service may provide subscription data to one or more event producers reporting as faulty such that the query subscription can be repaired.
- a system for processing query subscriptions in a messaging platform includes a queue including a stream of messages exchanged on the messaging platform executable by a server computer, where the messaging platform is configured to stream messages to a user interface of a client application executable by a computing device.
- the system includes a plurality of event producers, and an event producer manager configured to receive a query subscription and assign the query subscription to one or more of the plurality of event producers, where each event producer is configured to generate a response event in response to a message from the steam of messages satisfying the query subscription.
- the system includes a collector service configured to receive status responses from the plurality of event producers and store the status responses in a memory cache, where the collector service is configured to periodically determine a health status of the query subscription by querying the status responses in the memory cache. In response to the health status being determined as repairable, the collector service is configured to obtain subscription data relating to the subscription query from the memory cache and provide the subscription data to one or more event producers to restart the query subscription.
- the system may include one or more of the following features (or any combination thereof).
- the event producer manager includes an application programming interface (API) configured to receive the query subscription via a thrift call.
- API application programming interface
- the event producer manager is configured to monitor a number of query subscriptions processed at the plurality of event producers and a size of the message stream, and to adjust a number of the plurality of event producers based on the number of query subscriptions and the size of the message stream.
- the plurality of event producers are arranged in event producer groups, and the event producer manager is configured to assign the query subscription to a first event producer group and a second event producer group.
- the plurality of event producers are arranged in event producer groups, and the event producer manager is configured to assign the query subscription to at least one event producer group based on a user identifier associated with the query subscription.
- the collector service is configured to receive response events from the event producers, store the response events in the memory cache, and publish the response events on a response event bus.
- the collector service In response to receipt of new response event, the collector service is configured to determine whether the response events for the query subscription has exceeded a streaming rate threshold by querying the memory cache, where the collector service is configured to discard the new response event in response to the streaming rate threshold being exceeded. In response to receipt of a new response event, the collector service is configured to determine whether the message identifier of the new response event is stored in the memory cache, where the collector service is configured to publish the new response event on the response event bus and store the new response event in the memory cache in response to the message identifier not being stored in the memory cache. The collector service is configured to discard the new response event in response to the message identifier being stored in the memory cache.
- the plurality of event producers are arranged in event producer groups, and each event producer group includes a number of event producers such that the message stream is allocated between the event producers of a respective group.
- the system includes a subscription executor configured to transmit the query subscription to the event producer manager in response to receipt of a query subscription request received over a network from the client application, and a transport engine configured to create a delivery channel between the transport engine and the client application in response to receipt of a subscribe request received over the network from the client application such that messages identified by the response events are streamed, via the delivery channel, to the client application during a period of time in which the query subscription is active.
- the event producer manager is configured to delete the query subscription at each of the plurality of event producers for the assigned group in response to expiration of the query subscription.
- a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to receive a query subscription to match content in a queue that includes a stream of messages exchanged on a messaging platform executable by a server computer, assign the query subscription to one or more of a plurality of event producers, generate, by an individual event producer, a response event in response to a message from the respective portion of the stream of messages including a query term of the query subscription, receive, by a collector service, status responses from the event producers and store the status responses in a memory cache, periodically determine, by the collector service, a health status of the query subscription by querying the status responses in the memory cache, and, in response to the health status being determined as repairable, obtain subscription data relating to the subscription query from the memory cache, and provide the subscription data to one or more event producers to restart the query subscription.
- the non-transitory computer readable medium may store instructions configured to provide or cause one or more of the above/below features (or any combination thereof).
- the plurality of event producers are arranged in event producer groups, and the query subscription is assigned to an event producer group.
- the query subscription is assigned to the event producer group based on execution of a modulo operation using a user identifier associated with the query subscription.
- the operations may further include publish the response event on a response event bus and store the response event in the memory cache.
- the operations may further include determine whether a number of response events within a period of time has exceeded a streaming rate threshold and discard the response event in response to the streaming rate threshold being exceeded.
- the operations may further include determine whether the message identified by the response event has already been published to a response event bus and discard the response event in response to the message being determined as already been published to the response event bus.
- the operations may further include initiate transmission of a status message indicating the health status of the query subscription.
- the operations may further include transmit, by a subscription executor, the query subscription to an event producer manager in response to receipt of a query subscription request received over a network from the client application, create, by a transport engine, a delivery channel between the transport engine and the client application in response to receipt of a subscribe request received over the network from the client application, generate, by the subscription executor, the message based on a message identifier from the response event and a user identifier associated with the query subscription, and stream, by the transport engine, the message to the client application via the delivery channel during a period of time in which the query subscription is active.
- a method for processing query subscriptions in a messaging platform may include receiving, by an event producer manager, a query subscription to match content in a queue that includes a stream of messages exchanged on a messaging platform executable by a server computer, assigning, by the event producer manager, the query subscription to an event producer group of a plurality of event producer groups, each event producer group including a plurality of event producers, generating, by an individual event producer, a response event in response to a message from the respective portion of the stream of messages including a query term of the query subscription, publishing, by a collector service, the response event to a response event bus, receiving, by the collector service, status responses from the event producers and store the status responses in a memory cache, periodically determining, by the collector service, a health status of the query subscription by querying the status responses in the memory cache, and, in response to the health status being determined as repairable, obtaining subscription data relating to the subscription query from the memory cache, and providing the subscription data to one or more event producers to restart the query subscription.
- the method may include one or more of the above/below features (or any combination thereof).
- the query subscription is assigned to a primary event producer group and a secondary event producer group.
- the query subscription is assigned to the event producer group based on a user identifier associated with the query subscription.
- the method may include determining, by the collector service, whether a number of response events within a period of time has exceeded a streaming rate threshold before the publishing step, and discarding, by the collector service, the response event in response to the streaming rate threshold being exceeded.
- the method may include determining, by the collector service, whether the message identified by the response event has already been published to the response event bus before the publishing step, and discarding, by the collector service, the response event in response to the message being determined as already been published to the response event bus.
- a system for processing query subscriptions in a messaging platform includes a message queue including a stream of messages exchanged on the messaging platform executable by a server computer, an event producer configured to receive a query subscription and generate response events while the query subscription is active such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, a collector service configured to receive the response events and discard one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, and a transport engine configured to deliver, over a network, the messages to the client application according to the streaming rate.
- the system may include one or more of the above/below features (or any combination thereof).
- the collector service is configured to discard a new response event in response to a number of previously-received response events exceeding a threshold amount over a period of time.
- the collector service is configured to publish a new response event to a response event bus in response to a number of previously published response events being equal to or less than a threshold amount over a period of time.
- the collector service is configured to publish the response events to a response event bus and store the published response events in a memory cache, where, in response to a new response event, the collector service is configured to query the memory cache to determine the number of response events stored in the memory cache over a period of time and discard the new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time.
- Each response event includes a message identifier and subscription data that includes information about the query subscription.
- the system may include a subscription executor configured to receive the response events from the collector service via a response event bus, where the subscription executor is configured to generate a message for each response event based on a message identifier included in a respective response event and a user identifier associated with the query subscription.
- the collector service is configured to receive first response events for a first query subscription from the event producer and receive second response events for a second query subscription from the event producer, where the collector service configured to discard one or more of the first response events such that messages identified by the first response events are streamed by the transport engine via a first delivery channel in a manner that is equal to or less than a streaming rate threshold, and the collector service is configured to discard one or more of the second response events such that messages identified by the second response events are streamed by the transport engine via a second delivery channel in a manner that is equal to or less than the streaming rate threshold.
- the collector service may include a plurality of collector service instances, where each collector service instance configured to receive a separate portion of the response events and obtain a subset of response events by discarding one or more response events such that each subset includes a number of response events that is equal to or less than an individual streaming rate threshold.
- the system may include a memory cache configured to store each subset of response events received from a respective collector service instance, where at least one of the plurality of collector service instance is configured to aggregate the subsets and discard one or more response events from the aggregated subsets such that the aggregated subsets includes a number of response events that is equal to or less than a streaming rate threshold.
- the collector service is configured to receive engagement probability metrics for messages identified by the response events, where the engagement probability metrics indicates predicted levels of engagement with the messages, and the collector service is configured to discard one or more response events based on the engagement probability metrics.
- the collector service is configured to receive message health metrics for messages identified by the response events, where the message health metrics indicates risk levels of violating one or more conditions of the messaging platform, and the collector service configured to discard one or more response events based on the message health metrics.
- a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to receive a stream of messages exchanged on a messaging platform executable by a server computer, where the messaging platform is configured to deliver messages to a user interface of a client application executable by a computing device, receive a query subscription for an active query on the messaging platform, generate response events while the query subscription is active such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, discard one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, and deliver, over a network, the messages to the client application according to the streaming rate.
- the non-transitory computer-readable medium may include instructions that provide or cause one or more of the above/below features (or any combination thereof).
- a newly-received response event is discarded in response to a number of previously-received response events exceeding a threshold amount over a period of time.
- a newly-received response event is published to a response event bus in response to a number of previously published response events being equal to or less than a threshold amount over a period of time.
- the operations may further include publish the response events to a response event bus, store the published response events in a memory cache, and determine a number of response events stored in the memory cache over a period of time and discard a new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time.
- the operations may include receive the response events via a response event bus, where each response event includes a message identifier, and generate messages based on the response events such that a message is generated for each response event based on a message identifier included in a respective response event and a user identifier associated with the query subscription.
- a method for processing query subscriptions in a messaging platform includes receiving a stream of messages exchanged on the messaging platform executable by a server computer, receiving a query subscription for an active query on the messaging platform, generating response events such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, discarding one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, where each response event includes a messaging identifier, generating the messages based on the response event such that a message is generated based on the message identifier included within a respective response event and a user identifier associated with the subscription query, and delivering the messages, over a network, to the client application according to the streaming rate.
- the method may include one or more of the above/below features (or any combination thereof).
- a newly-received response event is discarded in response to a number of previously-received response events exceeding a threshold amount over a period of time.
- the method may include publishing the response events to a response event bus, storing the published response events in a memory cache, and determining a number of response events stored in the memory cache over a period of time and discard a new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time.
- the method may include receiving engagement probability metrics for messages identified by the response events, where the engagement probability metrics indicates predicted levels of engagements with the messages and discarding one or more response events based on the engagement probability metrics.
- the method may include receiving message health metrics for messages identified by the response events, where the message health metrics indicates risk levels of violating one or more conditions of the messaging platform and discarding one or more response events based on the message health metrics.
- a method for processing query subscriptions in a messaging platform to deliver real-time messages to client applications includes transmitting, by a subscription executor, a query subscription to an event producer system in response to receipt of a query subscription request from a client application, creating, by a transport engine, a delivery channel between the client application and the transport engine in response to receipt of a subscribe request from the client application, generating, at the event producer system, a response event in response to a message from a stream of messages having content that satisfies the query subscription, determining, by the subscription executor, whether an author of the message identified by the response event has restricted a user associated with the user identifier, discarding, by the subscription executor, the message identified by the response event in response to the user being determined as restricted by the author, and streaming, by the transport engine, the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- the method may include one or more of the above/below features (or any combination thereof).
- the query subscription request includes a query term and an expiration time.
- the event producer system includes a plurality of event producers, and the method includes assigning the query subscription to one or more of the plurality of event producers based on the user identifier.
- the subscribe request includes a transport topic and the user identifier.
- the method may include identifying, by the subscription executor, a transport topic in response to receipt of the query subscription request, generating, by the subscription executor, a subscription identifier in response to receipt of the query subscription request, and transmitting, over a network, by the subscription executor, a subscription status response to the client application, where the subscription status response includes the transport topic and the subscription identifier, and the subscribe request includes the transport topic and the subscription identifier.
- the method may include assigning, by an event producer manager, the query subscription to a plurality of event producers, storing the query subscription at each of the plurality of event producers, and generating, by each event producer, a response event in response to a message from the stream of messages having content that satisfies the query subscription.
- a messaging platform for processing query subscriptions to deliver real-time messages to client applications includes an event producer system configured to receive a stream of messages exchanged on the messaging platform and generate a response event in response to a message from the stream of messages having content that satisfies a query subscription, a subscription executor configured to determine whether an author of the message identified by the response event has restricted a user associated with the query subscription and discard the message identified by the response event in response to the user being determined as restricted by the author, and a transport engine configured to receive, over the network, a subscribe request from a client application to establish a delivery channel between the transport engine and the client application, where the transport engine is configured to stream the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- the messaging platform may include one or more of the above/below features (or any combination thereof).
- the subscription executor is configured to transmit the query subscription to the event producer system in response to receipt of a query subscription request from the client application.
- the subscription executor is configured to identify a transport topic in response to receipt of a query subscription request from the client application, where the subscription executor is configured to transmit, over the network, a subscription status response to the client application, and the subscription status response includes the transport topic.
- the subscription executor is configured to generate a subscription identifier that uniquely identifies the query subscription and transmit the subscription identifier in the subscription status response.
- the subscribe request includes a transport topic and a user identifier.
- the subscription executor is connected to a response event bus to obtain the response events as the response events are generated by the event producer system, each response event including a message identifier.
- the subscription executor us configured to generate the message based on the message identifier, where the subscription executor is configured to provide the message to the transport engine for delivery to the client application via the delivery channel.
- the subscription executor includes a GraphQL application programming interface (API) and a GraphQL executor.
- the GraphQL executor is configured to communicate with the GraphQL API to generate a JavaScript object notation (JSON) message for each response event.
- JSON JavaScript object notation
- the GraphQL executor is configured to provide the JSON message to the transport engine for delivery to the client application via the delivery channel.
- the event producer system includes an event producer manager and a plurality of event producers, where the event producer manager is configured to receive the query subscription from the subscription executor and assign the query subscription to one or more event producers of the plurality of event producers.
- a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to transmit, by a subscription executor, a query subscription to an event producer system in response to receipt of a query subscription request from a client application, create, by a transport engine, a delivery channel between the client application and the transport engine in response to receipt of a subscribe request from the client application, generate, at the event producer system, a response event in response to a message from a stream of messages having content that satisfies the query subscription, determine, by the subscription executor, whether an author of the message identified by the response event has restricted a user associated with the user identifier, discard, by the subscription executor, the message identified by the response event in response to the user being determined as restricted by the author, and stream, by the transport engine, the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- the non-transitory computer-readable medium may store instructions that provide one or more of the above/below features (or any combination thereof).
- the query subscription request includes a query term and an expiration time, where the subscribe request includes a transport topic, and the delivery channel is associated with the transport topic such that messages are streamed to the client application corresponding to the transport topic.
- the operations may include identify, by the subscription executor, a transport topic based on subscription data included in the query subscription request, generate, by the subscription executor, a subscription identifier based on the subscription data, and transmit, over a network, by the subscription executor, a subscription status response to the client application, where the subscription status response includes the transport topic and the subscription identifier.
- the subscribe request includes the transport topic and the subscription identifier.
- the operations may include assign the query subscription to one or more event producers of the event producer system, store the query subscription at each assigned event producer, and generate, by each event producer, a response event in response to a query term of the query subscription being matched against a message from the stream of messages.
- a method of processing query subscriptions for streaming real-time messages from a messaging platform includes transmitting, by a client application, a query subscription request, over a network, to a subscription executor of the messaging platform, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on a queue of messages exchanged on the messaging platform, transmitting, by the client application, a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receiving, by the client application, a stream of messages that satisfy a criteria of the query subscription via the delivery channel such that messages are streamed on a user interface of the client application while the query subscription is active, and periodically transmitting, by the client application, a subscribe renew request, over the network, to the transport engine, where the subscribe renew request is configured to cause the transport engine to renew the delivery channel and cause the subscription executor to renew the query subscription.
- the method may include one or more of the above/below features (or any combination thereof).
- the query subscription request includes a query term and a user identifier.
- the query subscription request includes an expiration time defining a period of time in which the query subscription is active.
- the subscribe request includes a transport topic, where the transport topic corresponds to one or more query terms associated with the query subscription.
- the method may include receiving, by the client application, a subscription status response, over the network, from the subscription executor, where the subscription status response includes a transport topic and a subscription identifier, and generating, by the client application, the subscribe request to include the transport topic and the subscription identifier.
- the query subscription request and the subscribe request are transmitted substantially in parallel with each other.
- the method may include receiving, by the client application, a channel identifier from the transport engine, the channel identifier identifying the delivery channel.
- the stream of messages is rendered on a timeline of the client application such that the messages are automatically streamed on the timeline over time.
- the timeline is a search column on the user interface of the client application, where the method further includes generating, by the client application, the query subscription request in response to the creation of the search column.
- the timeline is a home timeline of a user of the client application such that the messages are automatically streamed to the home timeline of the user.
- the stream of messages includes messages within a conversation graph relating to a conversation on the messaging platform.
- a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to transmit, by a client application executable by a computing device, a query subscription request, over a network, to a subscription executor of a messaging platform executable by a server computer, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on a queue of messages exchanged on the messaging platform, receive, by the client application, a status message response, over the network, from the subscription executor, where the status message response includes a transport topic, transmit, by the client application, a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request includes the transport topic, and the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receive, by the client application, a stream of messages that satisfy criteria of the query subscription via the delivery channel such that messages are streamed on a user interface of the client application at a
- the non-transitory computer-readable medium may store instructions that provide one or more of the above/below features (or any combination thereof).
- the query subscription request includes a query term, a user identifier, and an expiration time defining a period of time in which the query subscription is active.
- the query subscription request is a GraphQL subscription query.
- the operations may include receive, by the client application, a status message, over the network, from the transport engine via the delivery channel, and re-transmit, by the client application, the query subscription request and the subscribe request based on the status message.
- a system for processing query subscriptions for streaming real-time messages from a messaging platform includes a messaging platform, executable by a server computer, configured to generate a queue of messages exchanged on the messaging platform, and a client application, executable by a computing device, configured to render a timeline of social content on a user interface of the client application.
- the client application configured to transmit a query subscription request, over a network, to a subscription executor of the messaging platform, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on the queue of messages, transmit a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receive a stream of messages that satisfy criteria of the query subscription via the delivery channel such that the messages are streamed on a user interface of the client application at a streaming rate equal to or below a streaming rate threshold while the query subscription is active, and periodically transmit a subscribe renew request, over the network, to the transport engine, where the subscribe renew request is configured to cause the transport engine to renew the delivery channel and cause the subscription executor to renew the query subscription.
- the system may include one or more of the above/below features (or any combination thereof).
- the query subscription request is a GraphQL subscription query including a query term and a user identifier.
- the subscribe request includes a transport topic, where the transport topic corresponds to a query term, and the transport topic has a format compatible with the transport engine.
- the query subscription request and the subscribe request are transmitted substantially in parallel with each other.
- the client application is configured to automatically render the stream of messages on the timeline while the query subscription is active.
- the stream of messages includes messages related to a conversation, and the client application is configured to push the messages related to the conversation on the user interface as the message are generated and shared by the messaging platform.
- FIG. 1 is a schematic diagram of a system for streaming real-time messages over time to client applications according to query subscriptions that match content from a message stream having messages exchanged on a messaging platform according to an aspect.
- FIG. 2 illustrates a portion of the system depicting a transport engine, a subscription executor, and a client application for the generation of query subscriptions according to an aspect.
- FIG. 3 illustrates a portion of the system depicting an event producer system and the subscription executor for implementing the query subscription and generating response events according to an aspect.
- FIG. 4 illustrates a portion of the system depicting the subscription executor and the transport engine for delivering delivery events to the transport engine according to an aspect.
- FIG. 5 illustrates a portion of the system depicting the transport engine and the client application for streaming messages according to an aspect.
- FIG. 6 illustrates a portion of the system depicting the event producer system, the subscription executor, the transport engine, and the client application for renewing the query subscription according to an aspect.
- FIG. 7 illustrates an example of a user interface of the client application providing multiple timelines for streaming content according to an aspect.
- FIG. 8 illustrates a flowchart depicting example operations of a messaging platform for streaming messages according to query subscriptions according to an aspect.
- FIG. 9 illustrates a flowchart depicting example operations of a client application for steaming messages according to query subscriptions according to an aspect.
- FIG. 10A illustrates a schematic diagram of a system for streaming real-time messages over time to client applications according to query subscriptions that match content from a message stream having messages exchanged on a messaging platform according to an aspect.
- FIG. 10B illustrates an example of an event producer system according to an aspect.
- FIG. 11 illustrates an example of a collector service of the event producer system according to an aspect.
- FIG. 12 illustrates an example of a collector service having multiple collector service instances according to an aspect.
- FIG. 13 illustrates a flowchart depicting example operations of an event producer system according to an aspect.
- FIG. 14 illustrates a flowchart depicting example operations of a messaging platform for streaming messages below a threshold level according to an aspect.
- FIG. 1 is a schematic diagram of a system 100 including a messaging platform 104 executable by one or more server computers 102 , and a client application 126 executable by a computing device 124 according to an aspect.
- the messaging platform 104 is configured to stream real-time messages 132 over time to client applications 126 according to query subscriptions 141 that match content from a message stream 114 in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number of active query subscriptions 141 , and/or increases the security of matching the query subscriptions 141 and delivering those messages 132 in real-time from the perspective of the users that initiated the query subscriptions 141 .
- the messaging platform 104 is a platform for facilitating real-time communication between user devices (one of which is shown as computing device 124 ).
- the messaging platform 104 may store millions of accounts of individuals, businesses, and/or entities (e.g., pseudonym accounts, novelty accounts, etc.).
- One or more users of each account may use the messaging platform 104 to send messages to other accounts inside and/or outside of the messaging platform 104 .
- the messaging platform 104 may be configured to enable users to communicate in “real-time”, i.e., to converse with other users with minimal delay and to conduct a conversation with one or more other users during simultaneous sessions.
- the messaging platform 104 may allow a user to broadcast messages 132 and may display the messages 132 to one or more other users within a reasonable time frame to facilitate a live conversation between users.
- recipients of a message 132 may have a predefined graph relationship in a connection graph 169 with an account of the user broadcasting the message 132 .
- the client application 126 is configured to communicate with the messaging platform 104 over a network 150 .
- the client application 126 may be a social media messaging application in which users post and interact with messages 132 .
- the client application 126 is a native application executing on an operating system of the computing device 124 or may be a web-based application executing on the server computer 102 (or other server) in conjunction with a browser-based application of the computing device 124 .
- the computing device 124 may access the messaging platform 104 via the network 150 using any type of network connections and/or application programming interfaces (APIs) in a manner that permits the client application 126 and the messaging platform 104 to communicate with each other.
- APIs application programming interfaces
- the messages 132 may refer to message creation events such as the creation and posting of new messages to the messaging platform 104 .
- the messages 132 may refer to re-share events such as the re-sharing of previously posted messages on the messaging platform 104 .
- the messages 132 may refer to engagement events such as the favoritizing or liking of previously posted messages on the messaging platform 104 .
- the messaging platform 104 includes a subscription executor 116 , an event producer system 106 , and a transport engine 122 .
- the subscription executor 116 receives, over the network 150 , a query subscription request 140 from the client application 126 and send a query subscription 141 to the event producer system 106 to generate response events 156 such that a response event 156 is generated in response to a message from the message stream 114 satisfying criteria of the query subscription 141 .
- the transport engine 122 receives, over the network 150 , a subscribe request 154 from the client application 126 to establish a delivery channel 125 between the transport engine 122 and the client application 126 such that messages 132 satisfying the criteria of the query subscription 141 are stream via the delivery channel 125 , to the client application 126 in response to the response events 156 being generated during a period of time in which the query subscription 141 is active.
- the messages 132 are streamed to one or more timelines 130 . In some examples, the messages 132 are streamed in chronological order on the timeline 130 . In some examples, the messages 132 are streamed in reverse-chronological order on the timeline 130 . In some examples, the messages 132 are ranked on the timeline 130 . In some examples, the messages 132 are not ranked on the timeline 130 . In some examples, the timeline 130 is a column (e.g., a search column) on the user interface 128 that streams messages 132 in real-time that matches the search criteria.
- a column e.g., a search column
- the user may use the client application 126 to submit an active query to obtain messages 132 including the search term “dog,” and the client application 126 streams the messages 132 on the timeline 130 that include the search term “dog” until the active query expires (e.g., the user performs an action to close the query or the active query times out).
- the timeline 130 is a home timeline of the user account in which the client application 126 streams messages 132 in real-time from user accounts linked to the user account in the connection graph 169 stored at the messaging platform 104 .
- timeline 130 is a direct message timeline in which the client application 126 streams messages 132 sent directly to the user.
- the stream of messages 132 include messages within a conversation graph 167 relating to a conversation on the messaging platform 104 .
- the conversation graph 167 may define a reply structure of messages 132 relating to a conversation.
- the messages 132 relating to the conversation may be automatically pushed to the user interface 128 as users are replying to messages 132 in the conversation graph 167 .
- the management of query subscriptions 141 is separated from the delivery of the messages 132 by using two separate modules, e.g., the subscription executor 116 and the transport engine 122 .
- the client application 126 transmits two requests to the messaging platform 104 to initiate receiving real-time messages 132 , e.g., one directed to the subscription executor 116 for query subscription generation, and other one directed to the transport engine 122 to establish a delivery channel 125 to receive the messages 132 .
- the subscription executor 116 receives the query subscription request 140 from the client application 126 to implement the query subscription 141 at the event producer system 106 , and the transport engine 122 receives the subscribe request 154 from the client application 126 to establish the delivery channel 125 in which messages 132 identified by the event producer system 106 are streamed to the client application 126 .
- the subscription executor 116 may be a query language processor configured to receive a query request and generate a query response such as a JavaScript Object Notation (JSON) response.
- JSON JavaScript Object Notation
- the subscription executor 116 receives, over the network 150 , query subscription requests 140 from the client application 126 , and generates and sends the query subscriptions 141 to the event producer system 106 in response to the query subscription requests 140 .
- the subscription executor 116 subscribes to a response event bus 123 to receive the response events 156 from the event producer system 106 , generates (e.g., hydrates and applies visibility rules to) the messages 132 based on the response events 156 (thereby obtaining messages 132 with the perspective of the user), and publishes the messages 132 on a delivery event bus 121 that are provided to the transport engine 122 for delivery to the client application 126 .
- the subscription executor 116 includes a data query application programming interface (API) 118 and a data query executor 120 .
- the data query API 118 is communicatively connected to the data query executor 120 .
- the data query API 118 is a GraphQL API.
- the data query executor 120 is a GraphQL executor.
- GraphQL may specific three operation types such as query, mutation, and subscription.
- the data query API 118 includes a library (e.g., a GraphQL library) configured to support the subscription operations.
- the data query API 118 communicates with the client application 126 over a network connection (e.g., a HTTP connection) to receive and transmit information related to the generation and management of the query subscriptions 141 .
- a network connection e.g., a HTTP connection
- the data query API 118 includes an endpoint (e.g., a thrift endpoint) that is used by the data query executor 120 to execute queries against response events 156 received from the event producer system 106 .
- the data query executor 120 monitors and receives the response events 156 from the event producer system 106 via the response event bus 123 , delivers the response events 156 to the data query API 118 via the endpoint, receives the full messages 132 from the data query API 118 , and publishes delivery events 160 having the messages 132 to the delivery event bus 121 to be provided to the transport engine 122 for delivery to the client application 126 .
- the response event bus 123 and the delivery event bus 121 are separate distributed queue systems in which subscribers subscribe to the buses to receive events (e.g., the transport engine 122 subscribes to the delivery event bus 121 , and the data query executor 120 subscribes to the response event bus 123 ).
- the data query executor 120 may manage subscription renews.
- the transport engine 122 is the delivery mechanism for streaming the messages 132 to the client application 126 .
- the transport engine 122 is communicatively connected to the client application 126 over the network 150 .
- the transport engine 122 communicates with the client application 126 over a network connection (e.g., a HTTP connection) to receive and transmit information related to the generation of a delivery channel 125 established between the transport engine 122 and the client application 126 .
- a network connection e.g., a HTTP connection
- the transport engine 122 streams the message 132 included in the delivery event 160 over the delivery channel 125 .
- the transport engine 122 receive subscription renewal requests from the client application 126 to renew the query subscriptions 141 , which are provided to the subscription executor 116 and then to the event producer system 106 to renew the query subscriptions 141 .
- the event producer system 106 is configured to support streaming search-query-results by matching queries against messages of the message stream 114 of the message queue 112 .
- the event producer system 106 may include an event producer manager 108 , one or more event producers 110 , and a collector service 170 .
- the event producer manager 108 is an API.
- the event producer manager 108 is configured to communicate with the data query API 118 of the subscription executor 116 to receive new query subscriptions 141 .
- the event producer manager 108 may receive a query subscription 141 and assign the query subscription 141 to one or more of the event producers 110 .
- the event producer manager 108 may receive a query subscription 141 and assign the query subscription 141 to an event producer 110 (or a group of event producers 110 ) such that the query subscription 141 is stored at the event producer 110 (or at each event producer 110 in the group).
- the event producer(s) 110 receives the message stream 114 from the message queue 112 and identifies messages 132 that meet the search criteria of the query subscription 141 .
- the message stream 114 is a large stream of all the message 132 generated on the messaging platform 104 .
- the message stream 114 includes messages delivered at a rate over 10 k messages per second.
- the message stream 114 includes messages delivered at a rate over 25 k messages per second.
- the message stream 114 includes messages delivered at a rate over 50 k messages per second.
- the message stream 114 includes message creation events for messages created and posted on the messaging platform 104 , message re-share events for existing messages that are re-shared on the messaging platform 104 , and/or engagement events for existing messages that are favoritized or liked on the messaging platform 104 .
- FIG. 2 illustrates the system 100 depicting the operations of query subscription generation in further detail according to an aspect.
- the client application 126 may generate a query subscription request 140 and transmit, over the network, the query subscription request 140 to the data query API 118 of the subscription executor 116 .
- a user may the user interface 128 of the client application 126 to submit an active query, and, in response to the submission of the active query, the client application 126 may generate and send the query subscription request 140 .
- the query subscription request 140 is configured to initiate a new query subscription 141 and initiate the implementation of the query subscription 141 at the event producer system 106 .
- the query subscription request 140 is a GraphQL subscription query over hypertext transfer protocol (HTTP).
- HTTP hypertext transfer protocol
- the query subscription request 140 may include subscription data 142 .
- the subscription data 142 includes one or more query terms 144 and a user identifier 146 of a user.
- the query terms 144 include search terms provided by the user.
- the subscription data 142 includes variables and one or more operation names.
- the subscription data 142 includes a client application identifier, and an authenticated user identifier.
- the query subscription request 140 includes an expiration time 148 that indicates a time value in which the query subscription 141 is active. If the amount of time exceeds the expiration time 148 , the query subscription 141 may be considered timed-out (unless a renew request is received).
- the client application 126 determines a value for the expiration time 148 , which may be dependent upon the amount of time and/or the number of renewed subscriptions that have been sent by the client application 126 .
- the subscription executor 116 In response to receipt of the query subscription request 140 , the subscription executor 116 identifies a transport topic 134 based on the query term(s) 144 of the subscription data 142 .
- the transport topic 134 may be a descriptive and/or numerical identifier that is detectable by the transport engine 122 .
- the subscription executor 116 identifies the transport topic 134 using a topic library 135 that defines a plurality of transport topics. For example, the subscription executor 116 may identify one of the plurality of transport topics in the topic library 135 that corresponds to the query term(s) 144 .
- the subscription executor 116 may generate and send a response indicating that the query subscription 141 has failed.
- the data query API 118 identifies the transport topic 134 using the subscription data 142 .
- the data query executor 120 identifies the transport topic 134 using the subscription data 142 .
- the subscription executor 116 may generate a subscription identifier 136 based on the subscription data 142 .
- the subscription identifier 136 may be an identifier that identifies the query subscription 141 .
- the data query API 118 generates the subscription identifier 136 .
- the data query executor 120 generates the subscription identifier 136 .
- the subscription executor 116 may generate the subscription identifier 136 based on the user identifier 146 , the query term(s) 144 and/or other information included in the subscription data 142 such as variables, operation name(s)), the authenticated user identifier, and/or the client application identifier.
- the subscription executor 116 is configured to serialize and hash the subscription data 142 to generate the subscription identifier 136 .
- the data query API 118 is configured to transmit, over the network 150 , a subscription status response 152 to the client application 126 .
- the subscription status response 152 includes the transport topic 134 .
- the subscription status response 152 includes the subscription identifier 136 .
- the subscription status response 152 includes a status message indicating whether the query subscription request 140 is successful.
- the client application 126 may generate and transmit a subscribe request 154 , over the network 150 , to the transport engine 122 .
- the subscribe request 154 includes the transport topic 134 .
- the client application 126 uses the transport topic 134 identified in the subscription status response 152 for the subscribe request 154 .
- the client application 126 identifies the transport topic 134 using the subscription data 142 in the same manner as the subscription executor 116 .
- the subscribe request 154 includes the subscription identifier 136 .
- the subscribe request 154 includes the user identifier 146 .
- the client application 126 transmits the subscribe request 154 in response to receipt of the subscription status response 152 .
- the client application 126 transmits the subscribe request 154 substantially in parallel with the transmission of the query subscription request 140 . In some examples, the client application 126 sends the query subscription request 140 and then sends the subscribe request 154 within a period of less than 500 ms from the transmission of the query subscription request 140 . In some examples, the client application 126 sends the query subscription request 140 and then sends the subscribe request 154 within a period of 100-200 ms after sending the query subscription request 140 .
- the transport engine 122 establishes a delivery channel 125 with the client application 126 to stream the messages 132 to the client application 126 .
- the delivery channel 125 is associated with the transport topic 134 such that messages 132 delivered over the delivery channel 125 correspond to the transport topic 134 .
- the transport engine 122 subscribes the client application 126 to the transport topic 134 corresponding to the user identifier 146 and the query term 144 (and/or a contributor identifier).
- the delivery channel 125 remains open and active while the query subscription 141 is active.
- the transport engine 122 assigns a channel identifier to the delivery channel 125 .
- the transport engine 122 sends, over the network 150 , the channel identifier to the client application 126 .
- the client application 126 may periodically re-subscribe (e.g., every two-minutes) to the delivery channel 125 .
- the client application 126 may automatically send a re-subscribe request in response to the query being active (e.g., a visible search column is displayed on the user interface 128 ). If the query ends (e.g., a column is scrolled off the user interface 128 ), the client application 126 may send a message to the transport engine 122 to unsubscribe from the transport topic 134 , thereby closing the delivery channel 125 .
- FIG. 3 illustrates the system 100 depicting example operations of the event producer system 106 and the subscription executor 116 to configure the query subscription 141 at the event producer system 106 and receive response events 156 from the event producer system 106 according to an aspect.
- FIG. 4 illustrates the system 100 depicting example operations of the subscription executor 116 and the transport engine 122 to deliver delivery events 160 to the transport engine 122 .
- the data query API 118 In response to receipt of the query subscription request 140 , the data query API 118 generates and sends the query subscription 141 to the event producer manager 108 .
- the data query API 118 may send the query subscription 141 as a thrift request to the event producer manager 108 .
- a thrift request may be a remote procedure call system that is used to communicate between various components of the messaging platform 104 .
- the query subscription 141 includes the subscription data 142 (e.g., which may include the query term(s) 144 ), and the user identifier 146 ).
- the query subscription 141 includes the subscription identifier 136 .
- the query subscription 141 includes the expiration time 148 .
- the query subscription 141 sent to the event producer manager 108 may include the user identifier 146 and other subscription related data to enable the event producer system 106 to return them in the response events 156 to provide enough context to hydrate and route the messages 132 identified by the response events 156 .
- the event producer manager 108 may use the expiration time 148 to determine whether the query subscription 141 has timed-out. For example, if the time has exceeded the expiration time 148 , the event producer manager 108 may instruct the event producer 110 to delete the query subscription 141 , thereby saving resources for other query subscriptions 141 .
- the event producer manager 108 assigns the query subscription 141 to an event producer 110 (or a group of event producers 110 ). In some examples, the event producer manager 108 assigns the query subscription 141 based on the user identifier 146 .
- the query subscription 141 is stored at the event producer 110 (or each event producer 110 in the group).
- the event producer 110 generates the response events 156 such that a response event 156 is generated in response to a message from the message stream 114 being determined as containing a query term 144 of the query subscription 141 .
- the event producer 110 may publish the response events 156 to the response event bus 123 .
- the collector service 170 receives the response events 156 and publishes the response events 156 to the response event bus 132 . In some examples, as discussed in greater detail later in the disclosure, the collector service 170 may de-duplicate response events 156 relating to the same message 132 , discard one or more response events 156 so that the streaming rate is below a threshold level, and/or periodically generate status messages about the health of the query subscriptions 141 at the event producer system 106 .
- Each response event 156 includes a message identifier 158 that uniquely identifies the message 132 matching the query subscription 141 .
- each response event 156 includes the subscription data 142 (e.g., query term(s) 144 ), and the user identifier 146 ).
- each response event 156 includes the subscription identifier 136 .
- each response event 156 includes only the message identifier 158 .
- the subscription executor 116 subscribes to the response event bus 123 to obtain the response events 156 published by the event producer system 106 .
- the subscription executor 116 generates (e.g., hydrates) the messages 132 identified by the message identifiers 158 and applies visibility rules before providing the full messages 132 to the transport engine 122 .
- hydration may refer to the creation of the message 132 from the message identifier 158 and the user identifier 146 such that the generated message 132 has the format compatible with the client application 126 and includes data corresponding to the perspective of the user identified by the user identifier 146 .
- the subscription executor 116 is configured to generate a java script object notation (JSON) message (e.g., the full JSON message) based on the message identifier 158 and the user identifier 146 .
- JSON java script object notation
- the subscription executor 116 As the subscription executor 116 generates each message 132 corresponding to a respective response event 156 , the subscription executor 116 published a delivery event 160 that includes the message 132 to the delivery event bus 121 .
- JSON java script object notation
- the subscription executor 116 may discard a response event 156 if the subscription executor 116 determines that the message 132 identified by the message identifier 158 violates a visibility rule, thereby improving the security of the messaging platform 104 while being able to deliver real-time messages 132 to the client application 126 . For example, if the response event 156 identifies a message 132 authored by a user that restricted (e.g., blocked or muted) the user identified by the user identifier 146 , the subscription executor 116 may discard the response event 156 .
- restricted e.g., blocked or muted
- the data query executor 120 subscribes to the response event bus 123 .
- the data query executor 120 may monitor the response event bus 123 to obtain any response events 156 published to the response event bus 123 by the event producers 110 .
- the data query executor 120 may communicate with the data query API 118 to generate the message 132 in response to each response event 156 obtained from the response event bus 123 .
- the data query API 118 may receive both a query and an event and uses the event as the basis for the query execution.
- the data query executor 120 may deliver the message identifier 158 and subscription metadata (e.g., the subscription data 142 and/or subscription identifier 136 ) to the data query API 118 .
- the data query executor 120 executes a thrift request to the data query API 118 to deliver the message identifier 158 and the subscription metadata.
- the data query API 118 extracts data from the message identifier 158 and the subscription metadata and executes the original query subscription 141 against the response event 156 to generate the message 132 (e.g., the full JSON message).
- the data query executor 120 receives the execution results (e.g., the message 132 ) from the data query API 118 and publish a delivery event 160 on the delivery event bus 121 .
- the delivery event 160 includes the message 132 .
- the delivery event 160 includes transport topic data 162 that identifies the transport topic 134 .
- the transport engine 122 subscribes to the delivery event bus 121 to monitor and obtain delivery events 160 published by the data query executor 120 . For example, when a delivery event 160 is published to the delivery event bus 121 , the transport engine 122 obtains the delivery event 160 and determines which delivery channel 125 to stream the message 132 included within the delivery event 160 based on a channel-topic mapping 164 that maps delivery channels 125 to transport topics 134 . For example, the transport topic data 162 may identify the transport topic 134 associated with the message 132 , and the transport engine 122 may identify the appropriate delivery channel 125 to stream the message 132 based on the channel-topic mapping 164 . The transport engine 122 is configured to stream the message 132 to the client application 126 over the delivery channel 125 .
- FIG. 5 illustrates the system 100 depicting example operations of the transport engine 122 for multiple delivery channels 125 .
- the transport engine 122 creates a separate delivery channel 125 for each active query subscription 141 and then delivers those messages 132 over its respective delivery channel 125 .
- the transport engine 122 transmits, over the network 150 , the messages 132 received from the subscription executor 116 to the client application 126 via a first delivery channel 125 - 1 (e.g., the “dogs” delivery channel).
- the transport engine 122 transmits, over the network 150 , the messages 132 received from the subscription executor 116 to the client application 126 via a second delivery channel 125 - 2 (e.g., the “cats” communication channel).
- the client application 126 may renew with one of the subscription executor 116 or the transport engine 122 .
- the client application 126 renews with the transport engine 122 .
- the subscription to the transport topic 134 may expire after a time interval unless the subscription is renewed by the client application 126 (e.g. the client application 126 must renew with the transport engine 122 every period of time (e.g., every 2 minutes) or the query subscription 141 expires).
- FIG. 6 illustrates the system 100 depicting example operations of a renew operation according to an aspect.
- the subscription executor 116 e.g., the data query executor 120
- the client application 126 may transmit, over the network 150 , a subscribe renew request 161 to the transport engine 122 to renew the subscription to the transport topic 134 .
- the transport engine 122 may provide transport topic data 162 to the data query executor 120 .
- the transport topic data 162 may include information about the transport topic 134 , the subscription identifier 136 , and/or information about which event producer 110 is assigned to generate response events 156 for the user identifier 146 .
- the data query executor 120 may transmit a renew call 171 to the event producer system 106 .
- the event producer manager 108 may receive the renew call 171 and update the expiration time 148 so that the query subscription 141 is not deleted from the event producers 110 .
- the event producer manager 108 may publish a status message 166 to the response event bus 123 , which is received by the data query executor 120 .
- the data query executor 120 may publish the status message 166 on the delivery event bus 121 so that the transport engine 122 can deliver the status message 166 to the client application 126 .
- the computing device 124 may be a mobile computing device (e.g., a smart phone, a PDA, a tablet, or a laptop computer) or a non-mobile computing device (e.g., a desktop computing device).
- the computing device 124 also includes various network interface circuitry, such as for example, a mobile network interface through which the computing device 124 can communicate with a cellular network, a Wi-Fi network interface with which the computing device 124 can communicate with a Wi-Fi base station, a Bluetooth network interface with which the computing device 124 can communicate with other Bluetooth devices, and/or an Ethernet connection or other wired connection that enables the computing device 124 to access the network 150 .
- the server computer 102 may be a single computing device or may be a representation of two or more distributed computing devices communicatively connected to share workload and resources.
- the server computer 102 may include at least one processor and a non-transitory computer-readable medium that stores executable instructions that when executed by the at least one processor cause the at least one processor to perform the operations discussed herein.
- FIG. 7 illustrates an example of the user interface 728 of the client application 126 of FIG. 1 according to an aspect.
- the description of FIG. 7 also references components and messages explained with reference to FIGS. 1 through 6 .
- the client application 126 is configured to display multiple timelines as separate columns. For example, the user may add or remove columns, thereby adding or removing timelines.
- the addition of a column that specifies a search initiates a query subscription 141 .
- the removal of a column causes the query subscription 141 to expire.
- the user may add a first column that provides a first timeline 730 - 1 .
- the first timeline 730 - 1 may display messages 732 generated by a certain user (e.g., user A) while the query subscription 141 remains active. For example, while the first column is displayed, any messages 732 generated by user A are displayed on the first timeline 730 - 1 .
- user A may post a message 732 to the messaging platform 104 at a certain time, and the message 732 may be pushed to the first timeline 130 - 1 around the time that the message 732 was posted such that the user can view the newly created message 732 by user A in real-time or near real-time.
- the first timeline 730 - 1 is rendered in chronological order so that the newly created message 732 is pushed to the top of the first timeline 730 - 1 .
- the user may add a second column that provides a second timeline 730 - 2 of messages 732 that match the hashtag #GraphQL.
- the second timeline 730 - 2 may display messages 732 that include content having the search term “#GraphQL.”
- any messages 732 exchanged on the messaging platform 104 that include the search term “#GraphQL” are streamed to the second timeline 730 - 2 .
- the second timeline 730 - 2 is rendered in chronological order so that a newly created message 732 that includes the search term “#GraphQL” is pushed to the top of the second timeline 730 - 2 .
- the user may add a third column that provides a third timeline 730 - 3 of messages 732 that include the search term “GraphQL Summit”. For example, the addition of the third column indicating the search term “GraphQL Summit” initiates a query subscription 141 .
- the third timeline 730 - 3 may display messages 732 that include content that match the search term “GraphQL Summit.” For example, while the third column is displayed, any messages 732 that match the search term “GraphQL Summit” are streamed to the third timeline 730 - 3 while the query subscription 141 remains active.
- the third timeline 730 - 3 is rendered in chronological order so that a newly created message 732 that includes the search term “GraphQL Summit” is pushed to the top of the third timeline 730 - 3 .
- FIG. 8 illustrates a flowchart 800 depicting example operations of the messaging platform 104 for streaming real-time messages 132 according to query subscriptions 141 according to an aspect.
- the flowchart 800 is described with reference to the system 100 of FIGS. 1 through 6 .
- Operation 802 includes transmitting, by a subscription executor 116 , a query subscription 141 to an event producer system 106 in response to receipt of a query subscription request 140 from a client application 126 .
- the data query API 118 may receive the query subscription request 140 over the network 150 from the client application 126 , and the data query API 118 may generate the query subscription 141 .
- the data query API 118 may send the query subscription 141 to the event producer manager 108 .
- the query subscription request 140 is a GraphQL subscription query, where the data query API 118 is a GraphQL API and the data query executor 120 is a GraphQL executor.
- the query subscription request 140 includes a query term 144 and a user identifier 146 .
- the data query API 118 may identify a transport topic 134 in response to the query subscription request 140 .
- Operation 804 includes creating, by a transport engine 122 , a delivery channel 125 between the client application 126 and the transport engine 122 in response to receipt of a subscribe request 154 received over the network 150 from the client application 126 .
- the transport engine 122 may receive the subscribe request 154 over the network 150 from the client application 126 and create the delivery channel 125 in response to receipt of the subscribe request 154 .
- Operation 806 includes generating, at the event producer system 106 , a response event 156 in response to a message from a message stream 114 having content that satisfies the query subscription 141 .
- the event producer manager 108 may assign the query subscription 141 to one or more event producers 110 , where each event producer 110 generates a response event 156 when a message from the message stream 114 satisfies the query subscription 141 .
- Operation 808 includes determining, by the subscription executor 116 , whether an author of the message identified by the response event 156 has restricted (e.g., blocked or muted) a user associated with the user identifier 146 , and operation 810 includes discarding, by the subscription executor 116 , the message identified by the response event 156 in response to the user being determined as restricted by the author.
- the subscription executor 116 may discard a response event 156 if the subscription executor 116 determines that the message 132 identified by the message identifier 158 violates a visibility rule, thereby improving the security of the messaging platform 104 while being able to deliver real-time messages 132 to the client application 126 .
- the subscription executor 116 may discard the response event 156 if the response event 156 identifies a message 132 authored by a user that restricted (e.g., blocked or muted) the user identified by the user identifier 146 .
- Operation 812 includes streaming, by the transport engine 122 , the messages 132 to a user interface 128 of the client application 126 via the delivery channel 125 during a period of time in which the query subscription 141 is active in response to the user being determined as not restricted by the author. For example, as the transport engine 122 receives the delivery events 160 , the transport engine 122 streams the messages 132 (that do not violate visibility rules), over the network 150 , to the client application 126 .
- FIG. 9 illustrates a flowchart 900 depicting example operations of the client application 126 for generating an active query on the messaging platform 104 and receiving a stream of messages 132 that match the active query according to an aspect.
- the flowchart 800 is described with reference to the system 100 of FIGS. 1 through 6 .
- Operation 902 includes transmitting, by a client application 126 , a query subscription request 140 , over a network 150 , to a subscription executor 116 of the messaging platform 104 , where the query subscription request 140 is configured to cause the subscription executor 116 to generate a query subscription 141 to be executed on a message queue 112 of messages exchanged on the messaging platform 104 .
- Operation 904 includes transmitting, by the client application 126 , a subscribe request 154 , over the network 150 , to a transport engine 122 of the messaging platform 104 , where the subscribe request 154 is configured to cause the transport engine 122 to create a delivery channel 125 between the transport engine 122 and the client application 126 .
- Operation 906 includes receiving, by the client application 126 , a stream of messages 132 that satisfy criteria of the query subscription 141 via the delivery channel 125 such that the messages 132 are streamed on a user interface 128 of the client application 126 over time while the query subscription 141 is active.
- Operation 908 includes periodically transmitting, by the client application 126 , a subscribe renew request 161 , over the network 150 , to the transport engine 122 , where the subscribe renew request 161 configured to cause the transport engine 122 to renew the delivery channel 125 and cause the subscription executor 116 to renew the query subscription 141 .
- the transport engine 122 may provide the transport topic data 162 to the data query executor 120 .
- the data query executor 120 may transmit the renew call 171 to the event producer system 106 .
- the event producer manager 108 may receive the renew call 171 and update the expiration time 148 so that the query subscription 141 is not deleted from the event producers 110 .
- the event producer manager 108 may publish a status message 166 to the response event bus 123 , which is received by the data query executor 120 .
- the data query executor 120 may publish the status message 166 on the delivery event bus 121 so that the transport engine 122 can deliver the status message 166 to the client application 126 .
- the client application 126 may renew with only the transport engine 122 , and, as described below, the structure of the messaging platform 104 may cause the query subscription 141 to be renewed at the transport engine 122 and the subscription executor 116 , thereby decreasing the amount of communication transmitted between the client application 126 and the messaging platform 104 to maintain the query subscription 141 .
- FIG. 10A is a schematic diagram of a system 1000 including a messaging platform 1004 executable by one or more server computers 1002 , and a client application 1026 executable by a computing device 1024 according to an aspect.
- the messaging platform 1004 is configured to stream, over a network 1050 , real-time messages 1032 to a client application 1026 according to query subscriptions 1041 that match content from a large message stream 1014 of messages exchanged on the messaging platform 1004 .
- the messaging platform 1004 includes an event producer system 1006 , a message queue 1012 having a message stream 114 , a subscription executor 1016 , and a transport engine 1022 .
- FIG. 10B illustrates the event producer system 1006 in greater detail.
- the system 1000 may be an example of the system 100 of FIGS. 1 through 6 and may include any of the features discussed with reference to the previous figures.
- the event producer system 1006 includes an event producer manager 1008 , event producers 1010 communicatively connected to the event producer manager 1008 , and a collector service 1070 communicatively connected to the event producers 1010 .
- the event producer manager 1008 obtain query subscriptions 1041 and configured the event producers 1010 to match content from a message stream 1014 according to the criteria of the query subscriptions 1041 .
- the event producer manager 1008 is an API configured to receive a query subscription 1041 via a thrift request. In some examples, the event producer manager 1008 is configured to receive a query subscription 1041 from the subscription executor 1016 .
- the query subscription 1041 may define criteria that is used to identify messages from the message stream 1014 .
- the query subscription 1041 is a GraphQL query subscription.
- the query subscription 1041 includes subscription data that provides information about the query subscription 1041 .
- the query subscription 1041 includes one or more query terms, a user identifier, an expiration time, and/or a subscription identifier.
- the event producers 1010 are arranged in event producer groups 1013 to execute a relatively large number of query subscriptions 1041 against the message stream 1014 .
- the event producer system 1006 may include a plurality of event producer groups 1013 such as a first event producer group 1013 - 1 , a second event producer group 1013 - 2 , a third event producer group 1013 - 3 , and a fourth event producer group 1013 - 4 .
- the event producer groups 1013 may include any number of event producer groups 1013 .
- Each event producer group 1013 is configured to receive the full message stream 1014 . In other words, each event producer group 1013 is configured to independently monitor the full message stream 1014 .
- Each event producer group 1013 includes a plurality of event producers 1010 . Although FIG. 10B illustrates four event producers 1010 within each event producer group 1013 , each event producer group 1013 may include any number of event producers 1010 , which may be the same or different numbers across event producer groups 1013 .
- Each event producer 1010 within a respective event producer group 1013 may receive a separate portion of the message stream 1014 .
- the message stream 1014 is divided (e.g., equally divided or unequally divided) among the event producers 1010 within a particular event producer group 1013 .
- a first event producer receives a first portion of the message stream 1014
- a second event producer receives a second portion of the message stream 1014
- a third event producer receives a third portion of the message stream 1014
- a fourth event producer receives a fourth portion of the message stream 1014 , where the first through fourth portions cover the entire message stream 1014 .
- Each event producer group 1013 is allocated a portion of the query subscriptions 1041 . For example, if there are one hundred query subscriptions 1041 , twenty-five query subscriptions 1041 may be allocated to the first event producer group 1013 - 1 , twenty-five query subscriptions 1041 may be allocated to the second event producer group 1013 - 2 , twenty-five query subscriptions 1041 may be allocated to the third event producer group 1013 - 3 , and twenty-five query subscriptions 1041 may be allocated to the third event producer group 1013 - 3 . However, it is noted that the number of query subscriptions 1041 may be in the thousands or millions.
- the event producer manager 1008 may receive the query subscription 1041 and assign the query subscription 1041 to at least one of the event producer groups 1013 . In some examples, the event producer manager 1008 assigns the query subscription 1041 to an event producer group 1013 based on a user identifier of the query subscription 1041 . In some examples, the event producer manager 1008 is configured to execute a modulo operation using the user identifier and assign the query subscription 1041 based on the results of the modulo operation. The query subscription 1041 is stored at each of the event producers 1010 within the assigned event producer group 1013 .
- the event producer manager 1008 assigns the query subscription 1041 to two event producer groups 1013 , e.g., a primary event producer group and a second event producer group.
- the event producer manager 1008 may assign the query subscription 1041 to the first event producer group 1013 - 1 and the third event producer group 1013 - 3 , where each of the event producers 1010 within the first event producer group 1013 - 1 and the third event producer group 1013 - 3 stores the query subscription 1041 in memory. In this manner, if one of the event producer groups 1013 is fails, the query subscription 1041 can still be executed by the other event producer group 1013 assigned to the query subscription 1041 .
- the event producer manager 1008 is configured to monitor the number of query subscriptions 1041 being assigned and executed for each event producer group 1013 and configured to increase and/or decrease the number of event producer groups 1013 and/or the number of event producers 1010 within each event producer group 1013 . For instance, in response to the number of event producers 1010 in a particular event producer group 1013 being increased, each individual event producer 1010 may receive fewer messages from the message stream 1014 to process and consequently may have more computational capacity to handle extra searches. In response to the number of event producer groups 1013 being increased, the number of search terms allocated to the event producer 1010 may be reduced.
- Each event producer 1010 is configured to generate a response event 156 in response to the query subscription 1041 being matched against a message from the respective portion of the message stream 1014 .
- each response event 156 includes a message identifier and subscription data providing information about the query subscription 1041 .
- each event producer 1010 is configured to periodically generate status responses 1075 that indicate a health status of the query subscription 1041 at a respective event producer 1010 .
- Each status response 1075 may indicate whether there is an error associated with executing the query subscription 1041 .
- a status response 1075 may indicate a fail status indicating that there is an error with processing the query subscription 1041 at a particular event producer 1010 , or the status response 1075 may indicate an ok status indicating that the query subscription 1041 is properly functioning at the particular event producer 1010 .
- the query subscription 1041 is associated with an expiration time.
- the event producer manager 1008 is configured to monitor the amount of time that the query subscription 1041 is active at the assigned event producers 1010 , and if the time exceeds the value specified by the expiration time, the event producer manager 1008 may de-activate the query subscription 1041 by instructions the assigned event producers 1010 to delete the query subscription 1041 from memory, thereby saving resources at the event producer system 1006 . However, the event producer manager 1008 may receive the renew call before the expiration time expires, which renews the expiration time, thereby renewing the query subscription 1041 .
- the collector service 1070 is configured to receive the response events 1056 from the event producers 1010 and publish the response events 1056 to a response event bus 1023 . In some examples, the collector service 1070 may determine whether the message identified by the response event has already been published to the response event bus 1023 , and then discard the response event 1056 in response to the message being determined as already been published to the response event bus 1023 to avoid the duplication of messages sent to the client application. In some examples, the collector service 1070 may determine whether a number of response events 1056 within a period of time (e.g., one second) has exceeded a streaming rate threshold, and discard one or more response events 1056 (e.g., not publish one or more response events 1056 on the response event bus 123 ).
- a period of time e.g., one second
- the collector service 1070 is configured to receive the status responses 1075 from the event producers 1010 and periodically send a status message 1066 (e.g., fail, ok, and/or renew) by publishing the status message on the response event bus 1023 . If the status message 1066 indicates an error, the client application 1026 may be required to transmit the query subscription request and the subscribe request to re-start the query subscription 1041 . For example, the collector service 1070 may receive the status responses 1075 from the event producers 1010 , determine the health status of the query subscription 1041 based on the status responses 1075 , and initiate the transmission of a status message indicating the health status of the query subscription 1041 .
- a status message 1066 e.g., fail, ok, and/or renew
- FIG. 11 illustrates an example of a collector service 1170 according to an aspect.
- the collector service 1170 may be an example of the collector service 1070 of FIG. 10B and may include any of the features discussed with reference to the previous figures.
- the collector service 1170 may operate in conjunction with a memory cache 1180 before publishing the response events 1056 to the response event bus 1023 to de-duplicate messages 1032 identified by the response events 1056 and/or decrease a streaming rate so that the messages 1032 are delivered to the client application 1026 below a streaming rate threshold 1173 .
- the collector service 1170 may operate in conjunction with the memory cache 1180 to determine the health status of the query subscription 1041 to provide a status message 1066 to the client application 1026 or attempt to restart the query subscription 1041 .
- the collector service 1170 may include a de-duplicator 1172 configured to de-duplicate response events 1056 that identify messages 1032 already delivered to the client application 1026 .
- the query subscription 1041 is assigned to two event producer groups 1013 (each of which receives the full message stream 1014 ) to protect against an event producer failure, which may the event producers 1010 to identify duplicate messages 1032 .
- the de-duplicator 1172 is configured to identify duplicates so that the same message is not provided to the client application 1026 multiple times.
- the collector service 1170 publishes a response event 1056 to the response event bus 1023 , the collector service 1170 stores the response event 1056 in the memory cache 1180 .
- the de-duplicator 1172 determines whether a message identifier of the new response event 1056 is stored in the memory cache 1180 by querying the memory cache 1180 .
- the collector service 1170 publishes the new response event 1056 on the response event bus 1023 and stores the new response event 1056 in the memory cache 1180 .
- the de-duplicator 1172 is configured to discard the new response event 1056 .
- the collector service 1170 may include a status message handler 1174 configured to determine a health status for the query subscription 1041 by querying the status responses 1075 in the memory cache 1180 .
- the collector service 1170 may receive periodically the status responses 1075 from the event producers 1010 and store the status responses 1075 in the memory cache 1180 .
- the status message handler 1174 may periodically query the memory cache 1180 to obtain the status responses 1075 from the memory cache 1180 from the assigned event producers 1010 for a particular query subscription 1041 , and then transmit a status message 1066 by publishing the status message 10066 on the response event bus 123 .
- the status message 1066 may indicate a fail status, which may require the client application 1026 to re-generate the query subscription 1041 (e.g., it may be required to transmit the query subscription request and the subscribe request). If most or all of the status responses 1075 indicate an ok status, the status message 1066 may indicate an ok status.
- the collector service 1170 includes a subscription restarter 1176 configured to restart the query subscription 1041 at the event producers 1010 . If the status responses 1075 indicate that there was an error with the query subscription 1041 at one or more of the event producers 1010 , the subscription restarter 1176 may determine whether the query subscription 1041 is repairable based on subscription data associated with the response events 1056 , and, if so, the subscription restarter 1176 may transmit the subscription data to the one or more event producers 110 reporting negative status responses 1075 .
- the collector service 1170 includes a quota checker 1178 configured to discard one or more of the response events 1056 to control a streaming rate at which messages 1032 identified by the response events 1056 are delivered to the client application 1026 to be equal to or less than a streaming rate threshold 1173 .
- the streaming rate threshold 1173 is a value in a range of three messages per second to 20 messages per second. In some examples, the streaming rate threshold 1173 is 10 messages per second.
- the quota checker 1178 is configured to discard a new response event 1056 in response to a number of previously-received response events 1056 exceeding a threshold amount over a period of time (e.g., the new response event 1056 is the eleventh message in one second and the threshold is ten messages per second). However, if the number of previously-recited response events 1056 is equal to or less than a threshold amount over a period of time, the collector service 1170 may publish the new response event 1056 to the response event bus 1023 .
- the collector service 1170 may publish the response events 1056 to the response event bus 1023 and store the published response events 1056 in the memory cache 1180 .
- the quota checker 1178 may query the memory cache 1180 to determine the number of response events 1056 stored at the memory cache 1180 over a period of time, and then discard the new response event 1056 in response to the number of response events 1056 stored in the memory cache 1180 exceeding a threshold amount over a period of time.
- the quota checker 1178 is configured to receive engagement probability metrics 1177 for messages 1032 identified by the response events 156 , where the engagement probability metrics 1177 indicate predicted levels of engagement with the messages 1032 .
- the quota checker 1178 is configured to discard one or more response events 1056 based on the engagement probability metrics 1177 such that the streaming rate is equal to or less than the streaming rate threshold 1173 .
- users may engage with the messages 1032 by favoritizing, re-sharing, and/or commenting on the messages 1032 , which may be considered positive outcomes.
- the messaging platform 1004 may include machine-learning resources that predict the level of positive engagement with messages 1032 to be delivered to the user (e.g., how likely will the user engage (e.g., favoritize, re-share, and/or comment) with the message 1032 ), and the quota checker 1178 may receive those engagement probability metrics 1177 . If an engagement probability metric 1177 for a particular message 1032 is below a threshold level, the quota checker 1178 may discard that message 1032 in order to control the streaming rate.
- the engagement probability metrics 1177 includes predicted negative outcomes, e.g., the probability that the user might find the message 1032 abusive. In these examples, based on the engagement probability metrics 1177 , the quota checker 1178 may discard the messages 1032 having a higher likely of being considered as abusive (e.g., containing abusive content).
- the quota checker 1178 is configured to receive message health metrics 1179 for messages 1032 identified by the response events 1056 , where the message health metrics 1179 indicate risk levels of violating one or more conditions of the messaging platform 1004 (e.g., abusive behavior, hateful conduct, threats, etc.). The quota checker 1178 is configured to discard one or more response events 1056 based on the message health metrics 1179 such that the streaming rate is equal to or less than the streaming rate threshold 1173 .
- FIG. 12 illustrates an example of the collector service 1270 according to an aspect.
- the collector service 1270 may be example of the collector service 1170 of FIG. 11 and may include any of the features described with reference to the previous figures.
- the collector service 1270 may include a plurality of collector service instances 1271 such as a first collector service instance 1271 - 1 , a second collector service instance 1271 - 2 , and a third collector service instance 1271 - 3 . Although three collector service instances 1271 are illustrated in FIG. 12 , the collector service 1270 may include any number of collector service instances 1271 .
- Each collector service instance 1271 may receive a separate portion of the response events 1056 and/or the status responses 1075 .
- the first collector service instance 1271 - 1 may receive a first portion of the response events 1056 and/or the status responses 1075
- the second collector service instance 1271 - 2 may receive a second portion of the response events 1056 and/or the status responses 1075
- the third collector service instance 1271 - 3 may receive a third portion of the response events 1056 and/or the status responses 1075 .
- Each collector service instance 1271 may be a separate instance of the collector service 1170 of FIG. 11 .
- each collector service instance 1271 may perform any of the operations of the collector service 1170 of FIG. 11 .
- each of the collector service instance 1271 may include the functionalities of the de-duplicator 1172 , the status message handler 1174 , the subscription restarter 1176 , and/or the quota checker 1178 .
- the collector service 1270 is configured to perform a two-layer streaming rate adjustment process. For example, with respect to the first layer, each collector service instance 1271 may receive a separate portion of the response events 1056 and obtain a subset of response events 1056 by discarding one or more response events 1056 such that each subset includes a number of response events 10056 that is equal to or less than an individual streaming rate threshold 1284 .
- each collector service instance 1271 stores its subset in the memory cache 1180 , and at least one of the collector service instances 1271 aggregates the subsets and discards one or more response events 1056 from the aggregated subsets such that the aggregated subsets include a number of response events 1056 that is equal to or less than the streaming rate threshold 1173 .
- the first collector service instance 1271 - 1 may receive the first portion of the response events 1056 and obtain a first subset of those response events 1056 by discarding one or more response events 1056 to provide a streaming rate equal to or less than the individual streaming rate threshold 1284 . If the individual streaming rate threshold is four messages per second, the first collector service instance 1271 - 1 discards any messages beyond four within one second and stores the first subset in the memory cache 1180 . The second collector service instance 1271 - 2 may receive the second portion of the response events 1056 and obtain a second subset of those response events 1056 by discarding one or more response events 1056 to provide a streaming rate equal to or less than the individual streaming rate threshold 1284 .
- the second collector service instance 1271 - 2 discards any messages beyond four within one second and stores the second subset in the memory cache 1180 .
- the third collector service instance 1271 - 3 may receive the third portion of the response events 1056 and obtain a third subset of those response events 1056 by discarding one or more response events 1056 to provide a streaming rate equal to or less than the individual streaming rate threshold 1284 . If the individual streaming rate threshold is four messages per second, the third collector service instance 1271 - 3 discards any messages beyond four within one second and stores the third subset in the memory cache 1180 .
- the total number of messages is twelve, and the streaming rate threshold 1173 may be ten messages per second.
- the collector service instances 1271 aggregates the first, second, and third subsets and discards one or more response events 1056 from the aggregated subsets such that the aggregated subsets include a number of response events 1056 that is equal to or less than the streaming rate threshold 1173 . If the streaming rate threshold 1173 is ten messages per second, at least one of the collector service instances 1271 discards two response events 156 and publishes ten response events 1056 to the response event bus 1023 .
- the collector service 1270 is configured to perform a two-layer de-duplication process. For example, with respect to the first layer, each collector service instance 1271 may receive a separate portion of the response events 156 and remove any response events 1056 identifying the same message 1032 . Each collector service instance 1271 may store its respective group of the response events 1056 in the memory cache 1180 . At least one of the collector service instances 1271 may query the memory cache 1180 to aggregates the groups and discard any response events 1056 that identify the same message 1032 from the aggregated groups.
- FIG. 13 illustrates a flowchart 1300 depicting example operations of the system 1000 according to an aspect. Although the flowchart is discussed with reference to the system 1000 of FIGS. 10A and 10B , the operations of FIG. 13 may be applicable to any of the systems discussed herein.
- Operation 1302 includes receiving, by an event producer manager 1008 , a query subscription 1041 to match content in a message queue 1012 that includes a message stream 114 of messages exchanged on a messaging platform 1004 executable by a server computer 1002 , where the messaging platform 1004 configured to deliver messages 1032 to a user interface of a client application 1026 executable by a computing device. 1024
- Operation 1304 includes assigning, by the event producer manager 1008 , the query subscription 1041 to an event producer group 1013 of a plurality of event producer groups 1013 , where each event producer group 1013 is configured to receive the message stream 1014 of messages from the message queue 1012 , each event producer group 1013 includes a plurality of event producers 1010 , and each event producer 1010 configured to receive a separate portion of the message stream 1014 of messages.
- Operation 1306 includes generating, by an individual event producer 1010 , a response event 1056 in response to a message from the respective portion of the message stream 114 of messages including a query term of the query subscription 1041 .
- Operation 1308 includes publishing, by a collector service 1070 , the response event 1056 to a response event bus 1023 , where the response event 1056 includes a message identifier for the message 1032 to be delivered to the client application 1026 .
- FIG. 14 illustrates a flowchart 1400 depicting example operations of the system 1000 FIGS. 10A and 10B with the collector service 1170 of FIG. 11 and/or the collector service 1270 of FIG. 12 according to an aspect.
- the operations of FIG. 14 may be applicable to any of the systems discussed herein
- Operation 1402 includes receiving a message stream 1014 of messages exchanged on a messaging platform 1004 executable by a server computer 1002 , where the messaging platform 1004 is configured to deliver messages 1032 to a user interface of a client application 1026 executable by a computing device 1024 .
- Operation 1404 includes receiving a query subscription 1041 for an active query on the messaging platform 1004 .
- Operation 1406 includes generating response events 1056 while the query subscription 1041 is active such that a response event 1056 is generated in response to a message of the message stream 1014 of messages including a query term of the query subscription 1041 .
- Operation 1408 includes discarding one or more of the response events 1056 to control a streaming rate at which messages identified by the response events 1056 are delivered to the client application 1026 to be equal to or less than a streaming rate threshold 1173 .
- Operation 1410 includes delivering, over a network 1050 , the messages 1032 to the client application 1026 in a manner that is equal to or less than the streaming rate threshold 1173 .
- Implementations of the disclosure also relate to an apparatus for performing the operations herein.
- This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer.
- a computer program may be stored in a non-transitory computer readable storage medium, such as, but not limited to, any type of disk including floppy disks, optical disks, CD-ROMs and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, flash memory, or any type of media suitable for storing electronic instructions.
- example or “exemplary” are used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “example’ or “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects or designs. Rather, use of the words “example” or “exemplary” is intended to present concepts in a concrete fashion.
- the term “or” is intended to mean an inclusive “or” rather than an exclusive “or”. That is, unless specified otherwise, or clear from context, “X includes A or B” is intended to mean any of the natural inclusive permutations.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Business, Economics & Management (AREA)
- Computational Linguistics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Entrepreneurship & Innovation (AREA)
- Strategic Management (AREA)
- Human Resources & Organizations (AREA)
- Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Multimedia (AREA)
- Tourism & Hospitality (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Economics (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Preparation Of Clay, And Manufacture Of Mixtures Containing Clay Or Cement (AREA)
Abstract
This disclosure relates to streaming real-time messages over time to client applications according to query subscriptions that match content from a large stream of messages exchanged on a messaging platform in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number of active query subscriptions, and/or increases the security of matching the query subscriptions against messages generated from the perspective of the authors while delivering those messages in real-time from the perspective of the users that initiated the query subscriptions.
Description
- This application is a continuation of, and claims priority to, U.S. patent application Ser. No. 16/668,811, filed on Oct. 30, 2019, entitled “MANAGING QUERY SUBSCRIPTION RENEWALS IN A MESSAGING PLATFORM”, which claims priority to U.S. Patent Application No. 62/883,633, filed on Aug. 6, 2019, entitled “QUERY SUBSCRIPTION IN A MESSAGING PLATFORM FOR DELIVERING REAL-TIME MESSAGES”, the disclosures of which are incorporated by reference herein in their entirety.
- A social media messaging platform may facilitate the exchange of millions or hundreds of millions of social media messages among its users. The messages exchanged on the platform often can provide users of the platform the latest update or reporting on current events. In some examples, a user may submit a search on the platform and receive a stream of results such that the user can view messages over time that match one or more keywords. However, matching messages in a very large message stream over a period of time while rendering those messages to the user in real-time involve complex and technique technical challenges such as processing speed, computer resource allocation, and security issues.
- This disclosure relates to streaming real-time messages over time to client applications according to query subscriptions that match content from a large stream of messages exchanged on a messaging platform in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number of active query subscriptions, and/or increases the security of matching the query subscriptions against messages generated from the perspective of the authors while delivering those messages in real-time from the perspective of the users that initiated the query subscriptions.
- To establish an active query in which the client application begins to receive a stream of messages relating to the active query, the client application may generate and send a query subscription request (e.g., a GraphQL subscription query), over a network to a subscription executor (e.g., a GraphQL engine) of the messaging platform to cause the subscription executor to generate a query subscription and provide the query subscription to an event producer system of the messaging platform. Also, the client application may generate and send a subscribe request to a transport engine to create a delivery channel between the client application and the transport engine. The messages matched by the event producer system may be streamed to the client application via the delivery channel. In this manner, the management of query subscriptions is separated from the delivery of messages by using two separate modules, e.g., the subscription executor, the transport engine, which may increase the speed of delivery from query creation to the matching and then rendering of real-time messages to the client. Also, in some examples, since two subscriptions are generated (e.g., one at the subscription executor, and one at the transport engine), this may suggest that the client application would have to renew at both the subscription executor and the transport module. However, as discussed later in the disclosure, the client application may renew with the transport engine, and the structure of the messaging platform may cause the query subscription to be renewed at the transport engine and the subscription executor, thereby decreasing the amount of communication transmitted between the client application and the messaging platform to maintain the query subscription. Furthermore, the messaging platform may be capable of executing query subscriptions from thousands of client applications against a large message stream (e.g., over 50 k messages per second) and delivering tens of thousands of messages per second to the client applications.
- The user may not be required to refresh the user interface or submit another request view new messages on the user interface, but rather the messages are pushed to the user interface of the user in response to other users posting messages on the messaging platform that match the query subscription. For example, the user may enter a search term such as “dog” to generate an active query, and then receive a stream of messages that include the search term “dog” and continue to receive messages that include the search term “dog” as new messages are created and posted to the messaging platform until the active query expires. As opposed to a static query in which results are provided once around the time of submitting the static query (e.g., receiving a list of web results in response to a search request), the user may continue to view matched content after the submission of the active query (and until the active query expires).
- The event producer system includes an event producer manager and a plurality of event producers configured to simultaneously execute query subscriptions to identifying matching content. The event producer manager receives a query subscription from the subscription executor and assigns the query subscription to one or more event producers such that the query subscription is stored at the assigned event producer. In some examples, the event producer manager may manage the configuration of the event producers, e.g., causing the storage and removal of query subscriptions, to control the computing resources at the event producer system. For example, the event producer manager may remove expired (or faulty) query subscriptions from the event producers and assign new query subscriptions as they are received at the event producer manager. The assigned event producer generates a response event in response to a message from a message queue matching the query subscription. The response event may identify the message having content that is matched with the query subscription.
- The subscription executor receives the response events, generates the messages identified by the response events with data from the perspective of the user that initiated the query subscription, and provides the messages to the transport engine to be delivered via the delivery channel. For example, the messages in the message queue have been generated from the perspective of their authors. However, the messages delivered to the client applications may be required to have data from the perspective of the users that initiated the requests. The subscription executor may generate the messages (e.g., hydrate and apply visibility rules to the messages) after they have been matched by the event producer system but before delivery by the transport engine. In this manner, if an author of a matched message has restricted (e.g., blocked or muted) the user that initiated the query subscription, the subscription executor may discard that message, thereby increasing the security of the messaging platform. Furthermore, in some examples, since the response event may only include the data that the user had requested for the subscription, the amount of data published on an event bus may be decreased, causing no extra data sent to the client which may help save bandwidth to stream more events per second.
- In some examples, the event producers may be grouped into a plurality of event producer groups, where each event producer group receives the full message stream. Each producer group includes a plurality of event producers, where each event producer receives a separate portion of the full message stream. Each event producer group is allocated a separate portion of the query subscriptions. The event producer manager may assign a subscription query to an event producer group, where each event producer in the group stores and executes the query subscription. In some examples, the event producer manager may assign a subscription to a first event producer group and a second event producer group such that the query subscription can be maintained if there is an error at processing the query subscription at one of the event producer groups. In this manner, the system can easily control the amount of responses at the event producer system by increasing or decreasing the number of event producer groups and/or increasing or decreasing the number of event producers in each group to account for the fluctuating amount of query subscriptions and response events. For instance, in response to the number of event producers in a single event producer group being increased, each individual event producer may receive fewer messages from the message stream to process and consequently may have more computational capacity to handle extra searches. In response to the number of event producer groups being increased, the number of search terms allocated to the event producer may be reduced.
- In some examples, the event producer system includes a collector service that receives the response events from the event producers and discards one or more response events to control a streaming rate such that the messages identified by the response events are streamed to the client application in a manner that is equal to or below a streaming rate threshold. For example, if the messages are streamed at a fast rate, the user may not be able to consume the streamed messages. As such, the collector service may throttle the streaming rate so that the rate at which the messages are streamed is equal to or less than a threshold level. For example, if the streaming rate threshold is 10 messages per second, the collector service may discard response events over 10 within a one second time interval. In some examples, the collector service may discard messages based on other attributes besides the time of when the response events are generated. For example, the collector service may discard messages predicated as low quality or abusive to provide the messages at a streaming rate that is less than the threshold. In some example, the collector service may discard messages that are predicted to have low engagements to provide the messages at a streaming rate that is less than the threshold. These and other features are further discussed in the detailed disclosure.
- In some examples, the collector service receives status responses from the event producers and stores the status responses in a memory cache. The collector service may determine a health of the query subscription by periodically querying the memory cache for the status responses. If the collector service determines that the query subscription is repairable, the collector service may provide subscription data to one or more event producers reporting as faulty such that the query subscription can be repaired.
- According to an aspect, a system for processing query subscriptions in a messaging platform includes a queue including a stream of messages exchanged on the messaging platform executable by a server computer, where the messaging platform is configured to stream messages to a user interface of a client application executable by a computing device. The system includes a plurality of event producers, and an event producer manager configured to receive a query subscription and assign the query subscription to one or more of the plurality of event producers, where each event producer is configured to generate a response event in response to a message from the steam of messages satisfying the query subscription. The system includes a collector service configured to receive status responses from the plurality of event producers and store the status responses in a memory cache, where the collector service is configured to periodically determine a health status of the query subscription by querying the status responses in the memory cache. In response to the health status being determined as repairable, the collector service is configured to obtain subscription data relating to the subscription query from the memory cache and provide the subscription data to one or more event producers to restart the query subscription.
- According to some aspects, the system may include one or more of the following features (or any combination thereof). The event producer manager includes an application programming interface (API) configured to receive the query subscription via a thrift call. The event producer manager is configured to monitor a number of query subscriptions processed at the plurality of event producers and a size of the message stream, and to adjust a number of the plurality of event producers based on the number of query subscriptions and the size of the message stream. The plurality of event producers are arranged in event producer groups, and the event producer manager is configured to assign the query subscription to a first event producer group and a second event producer group. The plurality of event producers are arranged in event producer groups, and the event producer manager is configured to assign the query subscription to at least one event producer group based on a user identifier associated with the query subscription. The collector service is configured to receive response events from the event producers, store the response events in the memory cache, and publish the response events on a response event bus.
- In response to receipt of new response event, the collector service is configured to determine whether the response events for the query subscription has exceeded a streaming rate threshold by querying the memory cache, where the collector service is configured to discard the new response event in response to the streaming rate threshold being exceeded. In response to receipt of a new response event, the collector service is configured to determine whether the message identifier of the new response event is stored in the memory cache, where the collector service is configured to publish the new response event on the response event bus and store the new response event in the memory cache in response to the message identifier not being stored in the memory cache. The collector service is configured to discard the new response event in response to the message identifier being stored in the memory cache. The plurality of event producers are arranged in event producer groups, and each event producer group includes a number of event producers such that the message stream is allocated between the event producers of a respective group.
- The system includes a subscription executor configured to transmit the query subscription to the event producer manager in response to receipt of a query subscription request received over a network from the client application, and a transport engine configured to create a delivery channel between the transport engine and the client application in response to receipt of a subscribe request received over the network from the client application such that messages identified by the response events are streamed, via the delivery channel, to the client application during a period of time in which the query subscription is active. The event producer manager is configured to delete the query subscription at each of the plurality of event producers for the assigned group in response to expiration of the query subscription.
- According to an aspect, a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to receive a query subscription to match content in a queue that includes a stream of messages exchanged on a messaging platform executable by a server computer, assign the query subscription to one or more of a plurality of event producers, generate, by an individual event producer, a response event in response to a message from the respective portion of the stream of messages including a query term of the query subscription, receive, by a collector service, status responses from the event producers and store the status responses in a memory cache, periodically determine, by the collector service, a health status of the query subscription by querying the status responses in the memory cache, and, in response to the health status being determined as repairable, obtain subscription data relating to the subscription query from the memory cache, and provide the subscription data to one or more event producers to restart the query subscription.
- According to some aspects, the non-transitory computer readable medium may store instructions configured to provide or cause one or more of the above/below features (or any combination thereof). The plurality of event producers are arranged in event producer groups, and the query subscription is assigned to an event producer group. The query subscription is assigned to the event producer group based on execution of a modulo operation using a user identifier associated with the query subscription. The operations may further include publish the response event on a response event bus and store the response event in the memory cache. The operations may further include determine whether a number of response events within a period of time has exceeded a streaming rate threshold and discard the response event in response to the streaming rate threshold being exceeded. The operations may further include determine whether the message identified by the response event has already been published to a response event bus and discard the response event in response to the message being determined as already been published to the response event bus. The operations may further include initiate transmission of a status message indicating the health status of the query subscription. The operations may further include transmit, by a subscription executor, the query subscription to an event producer manager in response to receipt of a query subscription request received over a network from the client application, create, by a transport engine, a delivery channel between the transport engine and the client application in response to receipt of a subscribe request received over the network from the client application, generate, by the subscription executor, the message based on a message identifier from the response event and a user identifier associated with the query subscription, and stream, by the transport engine, the message to the client application via the delivery channel during a period of time in which the query subscription is active.
- According to an aspect, a method for processing query subscriptions in a messaging platform may include receiving, by an event producer manager, a query subscription to match content in a queue that includes a stream of messages exchanged on a messaging platform executable by a server computer, assigning, by the event producer manager, the query subscription to an event producer group of a plurality of event producer groups, each event producer group including a plurality of event producers, generating, by an individual event producer, a response event in response to a message from the respective portion of the stream of messages including a query term of the query subscription, publishing, by a collector service, the response event to a response event bus, receiving, by the collector service, status responses from the event producers and store the status responses in a memory cache, periodically determining, by the collector service, a health status of the query subscription by querying the status responses in the memory cache, and, in response to the health status being determined as repairable, obtaining subscription data relating to the subscription query from the memory cache, and providing the subscription data to one or more event producers to restart the query subscription.
- According to some aspects, the method may include one or more of the above/below features (or any combination thereof). The query subscription is assigned to a primary event producer group and a secondary event producer group. The query subscription is assigned to the event producer group based on a user identifier associated with the query subscription. The method may include determining, by the collector service, whether a number of response events within a period of time has exceeded a streaming rate threshold before the publishing step, and discarding, by the collector service, the response event in response to the streaming rate threshold being exceeded. The method may include determining, by the collector service, whether the message identified by the response event has already been published to the response event bus before the publishing step, and discarding, by the collector service, the response event in response to the message being determined as already been published to the response event bus.
- According to an aspect, a system for processing query subscriptions in a messaging platform includes a message queue including a stream of messages exchanged on the messaging platform executable by a server computer, an event producer configured to receive a query subscription and generate response events while the query subscription is active such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, a collector service configured to receive the response events and discard one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, and a transport engine configured to deliver, over a network, the messages to the client application according to the streaming rate.
- According to some aspects, the system may include one or more of the above/below features (or any combination thereof). The collector service is configured to discard a new response event in response to a number of previously-received response events exceeding a threshold amount over a period of time. The collector service is configured to publish a new response event to a response event bus in response to a number of previously published response events being equal to or less than a threshold amount over a period of time. The collector service is configured to publish the response events to a response event bus and store the published response events in a memory cache, where, in response to a new response event, the collector service is configured to query the memory cache to determine the number of response events stored in the memory cache over a period of time and discard the new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time. Each response event includes a message identifier and subscription data that includes information about the query subscription. The system may include a subscription executor configured to receive the response events from the collector service via a response event bus, where the subscription executor is configured to generate a message for each response event based on a message identifier included in a respective response event and a user identifier associated with the query subscription. The collector service is configured to receive first response events for a first query subscription from the event producer and receive second response events for a second query subscription from the event producer, where the collector service configured to discard one or more of the first response events such that messages identified by the first response events are streamed by the transport engine via a first delivery channel in a manner that is equal to or less than a streaming rate threshold, and the collector service is configured to discard one or more of the second response events such that messages identified by the second response events are streamed by the transport engine via a second delivery channel in a manner that is equal to or less than the streaming rate threshold.
- The collector service may include a plurality of collector service instances, where each collector service instance configured to receive a separate portion of the response events and obtain a subset of response events by discarding one or more response events such that each subset includes a number of response events that is equal to or less than an individual streaming rate threshold. The system may include a memory cache configured to store each subset of response events received from a respective collector service instance, where at least one of the plurality of collector service instance is configured to aggregate the subsets and discard one or more response events from the aggregated subsets such that the aggregated subsets includes a number of response events that is equal to or less than a streaming rate threshold. The collector service is configured to receive engagement probability metrics for messages identified by the response events, where the engagement probability metrics indicates predicted levels of engagement with the messages, and the collector service is configured to discard one or more response events based on the engagement probability metrics. The collector service is configured to receive message health metrics for messages identified by the response events, where the message health metrics indicates risk levels of violating one or more conditions of the messaging platform, and the collector service configured to discard one or more response events based on the message health metrics.
- According to an aspect, a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to receive a stream of messages exchanged on a messaging platform executable by a server computer, where the messaging platform is configured to deliver messages to a user interface of a client application executable by a computing device, receive a query subscription for an active query on the messaging platform, generate response events while the query subscription is active such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, discard one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, and deliver, over a network, the messages to the client application according to the streaming rate.
- According to some aspects, the non-transitory computer-readable medium may include instructions that provide or cause one or more of the above/below features (or any combination thereof). A newly-received response event is discarded in response to a number of previously-received response events exceeding a threshold amount over a period of time. A newly-received response event is published to a response event bus in response to a number of previously published response events being equal to or less than a threshold amount over a period of time. The operations may further include publish the response events to a response event bus, store the published response events in a memory cache, and determine a number of response events stored in the memory cache over a period of time and discard a new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time. The operations may include receive the response events via a response event bus, where each response event includes a message identifier, and generate messages based on the response events such that a message is generated for each response event based on a message identifier included in a respective response event and a user identifier associated with the query subscription.
- According to an aspect, a method for processing query subscriptions in a messaging platform includes receiving a stream of messages exchanged on the messaging platform executable by a server computer, receiving a query subscription for an active query on the messaging platform, generating response events such that a response event is generated in response to a message of the stream of messages including a query term of the query subscription, discarding one or more of the response events to control a streaming rate at which messages identified by the response events are delivered to the client application, where each response event includes a messaging identifier, generating the messages based on the response event such that a message is generated based on the message identifier included within a respective response event and a user identifier associated with the subscription query, and delivering the messages, over a network, to the client application according to the streaming rate.
- According to some aspects, the method may include one or more of the above/below features (or any combination thereof). A newly-received response event is discarded in response to a number of previously-received response events exceeding a threshold amount over a period of time. The method may include publishing the response events to a response event bus, storing the published response events in a memory cache, and determining a number of response events stored in the memory cache over a period of time and discard a new response event in response to the number of response events stored in the memory cache exceeding a threshold amount during the period of time. The method may include receiving engagement probability metrics for messages identified by the response events, where the engagement probability metrics indicates predicted levels of engagements with the messages and discarding one or more response events based on the engagement probability metrics. The method may include receiving message health metrics for messages identified by the response events, where the message health metrics indicates risk levels of violating one or more conditions of the messaging platform and discarding one or more response events based on the message health metrics.
- According to an aspect, a method for processing query subscriptions in a messaging platform to deliver real-time messages to client applications includes transmitting, by a subscription executor, a query subscription to an event producer system in response to receipt of a query subscription request from a client application, creating, by a transport engine, a delivery channel between the client application and the transport engine in response to receipt of a subscribe request from the client application, generating, at the event producer system, a response event in response to a message from a stream of messages having content that satisfies the query subscription, determining, by the subscription executor, whether an author of the message identified by the response event has restricted a user associated with the user identifier, discarding, by the subscription executor, the message identified by the response event in response to the user being determined as restricted by the author, and streaming, by the transport engine, the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- According to some aspects, the method may include one or more of the above/below features (or any combination thereof). The query subscription request includes a query term and an expiration time. The event producer system includes a plurality of event producers, and the method includes assigning the query subscription to one or more of the plurality of event producers based on the user identifier. The subscribe request includes a transport topic and the user identifier. The method may include identifying, by the subscription executor, a transport topic in response to receipt of the query subscription request, generating, by the subscription executor, a subscription identifier in response to receipt of the query subscription request, and transmitting, over a network, by the subscription executor, a subscription status response to the client application, where the subscription status response includes the transport topic and the subscription identifier, and the subscribe request includes the transport topic and the subscription identifier. The method may include assigning, by an event producer manager, the query subscription to a plurality of event producers, storing the query subscription at each of the plurality of event producers, and generating, by each event producer, a response event in response to a message from the stream of messages having content that satisfies the query subscription.
- According to an aspect, a messaging platform for processing query subscriptions to deliver real-time messages to client applications includes an event producer system configured to receive a stream of messages exchanged on the messaging platform and generate a response event in response to a message from the stream of messages having content that satisfies a query subscription, a subscription executor configured to determine whether an author of the message identified by the response event has restricted a user associated with the query subscription and discard the message identified by the response event in response to the user being determined as restricted by the author, and a transport engine configured to receive, over the network, a subscribe request from a client application to establish a delivery channel between the transport engine and the client application, where the transport engine is configured to stream the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- According to some aspects, the messaging platform may include one or more of the above/below features (or any combination thereof). The subscription executor is configured to transmit the query subscription to the event producer system in response to receipt of a query subscription request from the client application. The subscription executor is configured to identify a transport topic in response to receipt of a query subscription request from the client application, where the subscription executor is configured to transmit, over the network, a subscription status response to the client application, and the subscription status response includes the transport topic. The subscription executor is configured to generate a subscription identifier that uniquely identifies the query subscription and transmit the subscription identifier in the subscription status response. The subscribe request includes a transport topic and a user identifier.
- The subscription executor is connected to a response event bus to obtain the response events as the response events are generated by the event producer system, each response event including a message identifier. The subscription executor us configured to generate the message based on the message identifier, where the subscription executor is configured to provide the message to the transport engine for delivery to the client application via the delivery channel. The subscription executor includes a GraphQL application programming interface (API) and a GraphQL executor. The GraphQL executor is configured to communicate with the GraphQL API to generate a JavaScript object notation (JSON) message for each response event. The GraphQL executor is configured to provide the JSON message to the transport engine for delivery to the client application via the delivery channel. The event producer system includes an event producer manager and a plurality of event producers, where the event producer manager is configured to receive the query subscription from the subscription executor and assign the query subscription to one or more event producers of the plurality of event producers.
- According to an aspect, a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to transmit, by a subscription executor, a query subscription to an event producer system in response to receipt of a query subscription request from a client application, create, by a transport engine, a delivery channel between the client application and the transport engine in response to receipt of a subscribe request from the client application, generate, at the event producer system, a response event in response to a message from a stream of messages having content that satisfies the query subscription, determine, by the subscription executor, whether an author of the message identified by the response event has restricted a user associated with the user identifier, discard, by the subscription executor, the message identified by the response event in response to the user being determined as restricted by the author, and stream, by the transport engine, the message identified by the response event to the client application via the delivery channel during a period of time in which the query subscription is active in response to the user being determined as not restricted by the author.
- According to some aspects, the non-transitory computer-readable medium may store instructions that provide one or more of the above/below features (or any combination thereof). The query subscription request includes a query term and an expiration time, where the subscribe request includes a transport topic, and the delivery channel is associated with the transport topic such that messages are streamed to the client application corresponding to the transport topic. The operations may include identify, by the subscription executor, a transport topic based on subscription data included in the query subscription request, generate, by the subscription executor, a subscription identifier based on the subscription data, and transmit, over a network, by the subscription executor, a subscription status response to the client application, where the subscription status response includes the transport topic and the subscription identifier. The subscribe request includes the transport topic and the subscription identifier. The operations may include assign the query subscription to one or more event producers of the event producer system, store the query subscription at each assigned event producer, and generate, by each event producer, a response event in response to a query term of the query subscription being matched against a message from the stream of messages.
- According to an aspect, a method of processing query subscriptions for streaming real-time messages from a messaging platform includes transmitting, by a client application, a query subscription request, over a network, to a subscription executor of the messaging platform, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on a queue of messages exchanged on the messaging platform, transmitting, by the client application, a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receiving, by the client application, a stream of messages that satisfy a criteria of the query subscription via the delivery channel such that messages are streamed on a user interface of the client application while the query subscription is active, and periodically transmitting, by the client application, a subscribe renew request, over the network, to the transport engine, where the subscribe renew request is configured to cause the transport engine to renew the delivery channel and cause the subscription executor to renew the query subscription.
- According to some aspects, the method may include one or more of the above/below features (or any combination thereof). The query subscription request includes a query term and a user identifier. The query subscription request includes an expiration time defining a period of time in which the query subscription is active. The subscribe request includes a transport topic, where the transport topic corresponds to one or more query terms associated with the query subscription. The method may include receiving, by the client application, a subscription status response, over the network, from the subscription executor, where the subscription status response includes a transport topic and a subscription identifier, and generating, by the client application, the subscribe request to include the transport topic and the subscription identifier. The query subscription request and the subscribe request are transmitted substantially in parallel with each other. The method may include receiving, by the client application, a channel identifier from the transport engine, the channel identifier identifying the delivery channel. The stream of messages is rendered on a timeline of the client application such that the messages are automatically streamed on the timeline over time. The timeline is a search column on the user interface of the client application, where the method further includes generating, by the client application, the query subscription request in response to the creation of the search column. The timeline is a home timeline of a user of the client application such that the messages are automatically streamed to the home timeline of the user. The stream of messages includes messages within a conversation graph relating to a conversation on the messaging platform.
- According to an aspect, a non-transitory computer-readable medium stores executable instructions that when executed by at least one processor are configured to cause the at least one processor to transmit, by a client application executable by a computing device, a query subscription request, over a network, to a subscription executor of a messaging platform executable by a server computer, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on a queue of messages exchanged on the messaging platform, receive, by the client application, a status message response, over the network, from the subscription executor, where the status message response includes a transport topic, transmit, by the client application, a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request includes the transport topic, and the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receive, by the client application, a stream of messages that satisfy criteria of the query subscription via the delivery channel such that messages are streamed on a user interface of the client application at a streaming rate equal to or below a streaming rate threshold while the query subscription is active, and periodically transmit, by the client application, a subscribe renew request, over the network, to the transport engine, where the subscribe renew request is configured to cause the transport engine to renew the delivery channel and cause the subscription executor to renew the query subscription.
- According to some aspects, the non-transitory computer-readable medium may store instructions that provide one or more of the above/below features (or any combination thereof). The query subscription request includes a query term, a user identifier, and an expiration time defining a period of time in which the query subscription is active. The query subscription request is a GraphQL subscription query. The operations may include receive, by the client application, a status message, over the network, from the transport engine via the delivery channel, and re-transmit, by the client application, the query subscription request and the subscribe request based on the status message.
- According to an aspect, a system for processing query subscriptions for streaming real-time messages from a messaging platform includes a messaging platform, executable by a server computer, configured to generate a queue of messages exchanged on the messaging platform, and a client application, executable by a computing device, configured to render a timeline of social content on a user interface of the client application. The client application configured to transmit a query subscription request, over a network, to a subscription executor of the messaging platform, where the query subscription request is configured to cause the subscription executor to generate a query subscription to be executed on the queue of messages, transmit a subscribe request, over the network, to a transport engine of the messaging platform, where the subscribe request is configured to cause the transport engine to create a delivery channel between the transport engine and the client application, receive a stream of messages that satisfy criteria of the query subscription via the delivery channel such that the messages are streamed on a user interface of the client application at a streaming rate equal to or below a streaming rate threshold while the query subscription is active, and periodically transmit a subscribe renew request, over the network, to the transport engine, where the subscribe renew request is configured to cause the transport engine to renew the delivery channel and cause the subscription executor to renew the query subscription.
- According to some aspects, the system may include one or more of the above/below features (or any combination thereof). The query subscription request is a GraphQL subscription query including a query term and a user identifier. The subscribe request includes a transport topic, where the transport topic corresponds to a query term, and the transport topic has a format compatible with the transport engine. The query subscription request and the subscribe request are transmitted substantially in parallel with each other. The client application is configured to automatically render the stream of messages on the timeline while the query subscription is active. The stream of messages includes messages related to a conversation, and the client application is configured to push the messages related to the conversation on the user interface as the message are generated and shared by the messaging platform.
-
FIG. 1 is a schematic diagram of a system for streaming real-time messages over time to client applications according to query subscriptions that match content from a message stream having messages exchanged on a messaging platform according to an aspect. -
FIG. 2 illustrates a portion of the system depicting a transport engine, a subscription executor, and a client application for the generation of query subscriptions according to an aspect. -
FIG. 3 illustrates a portion of the system depicting an event producer system and the subscription executor for implementing the query subscription and generating response events according to an aspect. -
FIG. 4 illustrates a portion of the system depicting the subscription executor and the transport engine for delivering delivery events to the transport engine according to an aspect. -
FIG. 5 illustrates a portion of the system depicting the transport engine and the client application for streaming messages according to an aspect. -
FIG. 6 illustrates a portion of the system depicting the event producer system, the subscription executor, the transport engine, and the client application for renewing the query subscription according to an aspect. -
FIG. 7 illustrates an example of a user interface of the client application providing multiple timelines for streaming content according to an aspect. -
FIG. 8 illustrates a flowchart depicting example operations of a messaging platform for streaming messages according to query subscriptions according to an aspect. -
FIG. 9 illustrates a flowchart depicting example operations of a client application for steaming messages according to query subscriptions according to an aspect. -
FIG. 10A illustrates a schematic diagram of a system for streaming real-time messages over time to client applications according to query subscriptions that match content from a message stream having messages exchanged on a messaging platform according to an aspect. -
FIG. 10B illustrates an example of an event producer system according to an aspect. -
FIG. 11 illustrates an example of a collector service of the event producer system according to an aspect. -
FIG. 12 illustrates an example of a collector service having multiple collector service instances according to an aspect. -
FIG. 13 illustrates a flowchart depicting example operations of an event producer system according to an aspect. -
FIG. 14 illustrates a flowchart depicting example operations of a messaging platform for streaming messages below a threshold level according to an aspect. -
FIG. 1 is a schematic diagram of asystem 100 including a messaging platform 104 executable by one ormore server computers 102, and aclient application 126 executable by acomputing device 124 according to an aspect. The messaging platform 104 is configured to stream real-time messages 132 over time toclient applications 126 according toquery subscriptions 141 that match content from amessage stream 114 in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number ofactive query subscriptions 141, and/or increases the security of matching thequery subscriptions 141 and delivering thosemessages 132 in real-time from the perspective of the users that initiated thequery subscriptions 141. - The messaging platform 104 is a platform for facilitating real-time communication between user devices (one of which is shown as computing device 124). The messaging platform 104 may store millions of accounts of individuals, businesses, and/or entities (e.g., pseudonym accounts, novelty accounts, etc.). One or more users of each account may use the messaging platform 104 to send messages to other accounts inside and/or outside of the messaging platform 104. The messaging platform 104 may be configured to enable users to communicate in “real-time”, i.e., to converse with other users with minimal delay and to conduct a conversation with one or more other users during simultaneous sessions. In other words, the messaging platform 104 may allow a user to broadcast
messages 132 and may display themessages 132 to one or more other users within a reasonable time frame to facilitate a live conversation between users. In some examples, recipients of amessage 132 may have a predefined graph relationship in aconnection graph 169 with an account of the user broadcasting themessage 132. - The
client application 126 is configured to communicate with the messaging platform 104 over anetwork 150. Theclient application 126 may be a social media messaging application in which users post and interact withmessages 132. In some examples, theclient application 126 is a native application executing on an operating system of thecomputing device 124 or may be a web-based application executing on the server computer 102 (or other server) in conjunction with a browser-based application of thecomputing device 124. Thecomputing device 124 may access the messaging platform 104 via thenetwork 150 using any type of network connections and/or application programming interfaces (APIs) in a manner that permits theclient application 126 and the messaging platform 104 to communicate with each other. - The
messages 132 may refer to message creation events such as the creation and posting of new messages to the messaging platform 104. In some examples, themessages 132 may refer to re-share events such as the re-sharing of previously posted messages on the messaging platform 104. In some examples, themessages 132 may refer to engagement events such as the favoritizing or liking of previously posted messages on the messaging platform 104. - The messaging platform 104 includes a
subscription executor 116, anevent producer system 106, and atransport engine 122. Thesubscription executor 116 receives, over thenetwork 150, aquery subscription request 140 from theclient application 126 and send aquery subscription 141 to theevent producer system 106 to generateresponse events 156 such that aresponse event 156 is generated in response to a message from themessage stream 114 satisfying criteria of thequery subscription 141. Thetransport engine 122 receives, over thenetwork 150, asubscribe request 154 from theclient application 126 to establish adelivery channel 125 between thetransport engine 122 and theclient application 126 such thatmessages 132 satisfying the criteria of thequery subscription 141 are stream via thedelivery channel 125, to theclient application 126 in response to theresponse events 156 being generated during a period of time in which thequery subscription 141 is active. - In some examples, the
messages 132 are streamed to one ormore timelines 130. In some examples, themessages 132 are streamed in chronological order on thetimeline 130. In some examples, themessages 132 are streamed in reverse-chronological order on thetimeline 130. In some examples, themessages 132 are ranked on thetimeline 130. In some examples, themessages 132 are not ranked on thetimeline 130. In some examples, thetimeline 130 is a column (e.g., a search column) on the user interface 128 that streamsmessages 132 in real-time that matches the search criteria. For example, the user may use theclient application 126 to submit an active query to obtainmessages 132 including the search term “dog,” and theclient application 126 streams themessages 132 on thetimeline 130 that include the search term “dog” until the active query expires (e.g., the user performs an action to close the query or the active query times out). - In some examples, the
timeline 130 is a home timeline of the user account in which theclient application 126streams messages 132 in real-time from user accounts linked to the user account in theconnection graph 169 stored at the messaging platform 104. In some examples,timeline 130 is a direct message timeline in which theclient application 126streams messages 132 sent directly to the user. In some examples, the stream ofmessages 132 include messages within aconversation graph 167 relating to a conversation on the messaging platform 104. Theconversation graph 167 may define a reply structure ofmessages 132 relating to a conversation. In some examples, themessages 132 relating to the conversation may be automatically pushed to the user interface 128 as users are replying tomessages 132 in theconversation graph 167. - As discussed herein, the management of
query subscriptions 141 is separated from the delivery of themessages 132 by using two separate modules, e.g., thesubscription executor 116 and thetransport engine 122. For example, theclient application 126 transmits two requests to the messaging platform 104 to initiate receiving real-time messages 132, e.g., one directed to thesubscription executor 116 for query subscription generation, and other one directed to thetransport engine 122 to establish adelivery channel 125 to receive themessages 132. Thesubscription executor 116 receives thequery subscription request 140 from theclient application 126 to implement thequery subscription 141 at theevent producer system 106, and thetransport engine 122 receives thesubscribe request 154 from theclient application 126 to establish thedelivery channel 125 in whichmessages 132 identified by theevent producer system 106 are streamed to theclient application 126. - The
subscription executor 116 may be a query language processor configured to receive a query request and generate a query response such as a JavaScript Object Notation (JSON) response. Generally, thesubscription executor 116 receives, over thenetwork 150,query subscription requests 140 from theclient application 126, and generates and sends thequery subscriptions 141 to theevent producer system 106 in response to the query subscription requests 140. Thesubscription executor 116 subscribes to aresponse event bus 123 to receive theresponse events 156 from theevent producer system 106, generates (e.g., hydrates and applies visibility rules to) themessages 132 based on the response events 156 (thereby obtainingmessages 132 with the perspective of the user), and publishes themessages 132 on adelivery event bus 121 that are provided to thetransport engine 122 for delivery to theclient application 126. - In some examples, the
subscription executor 116 includes a data query application programming interface (API) 118 and adata query executor 120. The data queryAPI 118 is communicatively connected to the data queryexecutor 120. In some examples, the data queryAPI 118 is a GraphQL API. In some examples, the data queryexecutor 120 is a GraphQL executor. GraphQL may specific three operation types such as query, mutation, and subscription. In some examples, the data queryAPI 118 includes a library (e.g., a GraphQL library) configured to support the subscription operations. The data queryAPI 118 communicates with theclient application 126 over a network connection (e.g., a HTTP connection) to receive and transmit information related to the generation and management of thequery subscriptions 141. In some examples, the data queryAPI 118 includes an endpoint (e.g., a thrift endpoint) that is used by the data queryexecutor 120 to execute queries againstresponse events 156 received from theevent producer system 106. - The data query
executor 120 monitors and receives theresponse events 156 from theevent producer system 106 via theresponse event bus 123, delivers theresponse events 156 to thedata query API 118 via the endpoint, receives thefull messages 132 from the data queryAPI 118, and publishesdelivery events 160 having themessages 132 to thedelivery event bus 121 to be provided to thetransport engine 122 for delivery to theclient application 126. In some examples, theresponse event bus 123 and thedelivery event bus 121 are separate distributed queue systems in which subscribers subscribe to the buses to receive events (e.g., thetransport engine 122 subscribes to thedelivery event bus 121, and the data queryexecutor 120 subscribes to the response event bus 123). Also, as further described later in the disclosure, the data queryexecutor 120 may manage subscription renews. - The
transport engine 122 is the delivery mechanism for streaming themessages 132 to theclient application 126. Thetransport engine 122 is communicatively connected to theclient application 126 over thenetwork 150. Thetransport engine 122 communicates with theclient application 126 over a network connection (e.g., a HTTP connection) to receive and transmit information related to the generation of adelivery channel 125 established between thetransport engine 122 and theclient application 126. As thetransport engine 122 receives adelivery event 160, thetransport engine 122 streams themessage 132 included in thedelivery event 160 over thedelivery channel 125. Further, thetransport engine 122 receive subscription renewal requests from theclient application 126 to renew thequery subscriptions 141, which are provided to thesubscription executor 116 and then to theevent producer system 106 to renew thequery subscriptions 141. - The
event producer system 106 is configured to support streaming search-query-results by matching queries against messages of themessage stream 114 of themessage queue 112. Theevent producer system 106 may include anevent producer manager 108, one ormore event producers 110, and acollector service 170. In some examples, theevent producer manager 108 is an API. Theevent producer manager 108 is configured to communicate with the data queryAPI 118 of thesubscription executor 116 to receivenew query subscriptions 141. Theevent producer manager 108 may receive aquery subscription 141 and assign thequery subscription 141 to one or more of theevent producers 110. For example, theevent producer manager 108 may receive aquery subscription 141 and assign thequery subscription 141 to an event producer 110 (or a group of event producers 110) such that thequery subscription 141 is stored at the event producer 110 (or at eachevent producer 110 in the group). - The event producer(s) 110 receives the
message stream 114 from themessage queue 112 and identifiesmessages 132 that meet the search criteria of thequery subscription 141. In some examples, themessage stream 114 is a large stream of all themessage 132 generated on the messaging platform 104. In some examples, themessage stream 114 includes messages delivered at a rate over 10 k messages per second. In some examples, themessage stream 114 includes messages delivered at a rate over 25 k messages per second. In some examples, themessage stream 114 includes messages delivered at a rate over 50 k messages per second. In some examples, themessage stream 114 includes message creation events for messages created and posted on the messaging platform 104, message re-share events for existing messages that are re-shared on the messaging platform 104, and/or engagement events for existing messages that are favoritized or liked on the messaging platform 104. -
FIG. 2 illustrates thesystem 100 depicting the operations of query subscription generation in further detail according to an aspect. Referring toFIGS. 1 and 2 , theclient application 126 may generate aquery subscription request 140 and transmit, over the network, thequery subscription request 140 to the data queryAPI 118 of thesubscription executor 116. In some examples, a user may the user interface 128 of theclient application 126 to submit an active query, and, in response to the submission of the active query, theclient application 126 may generate and send thequery subscription request 140. In some examples, thequery subscription request 140 is configured to initiate anew query subscription 141 and initiate the implementation of thequery subscription 141 at theevent producer system 106. In some examples, thequery subscription request 140 is a GraphQL subscription query over hypertext transfer protocol (HTTP). - The
query subscription request 140 may includesubscription data 142. Thesubscription data 142 includes one ormore query terms 144 and a user identifier 146 of a user. In some examples, thequery terms 144 include search terms provided by the user. In some examples, thesubscription data 142 includes variables and one or more operation names. In some examples, thesubscription data 142 includes a client application identifier, and an authenticated user identifier. In some examples, thequery subscription request 140 includes anexpiration time 148 that indicates a time value in which thequery subscription 141 is active. If the amount of time exceeds theexpiration time 148, thequery subscription 141 may be considered timed-out (unless a renew request is received). In some examples, theclient application 126 determines a value for theexpiration time 148, which may be dependent upon the amount of time and/or the number of renewed subscriptions that have been sent by theclient application 126. - In response to receipt of the
query subscription request 140, thesubscription executor 116 identifies atransport topic 134 based on the query term(s) 144 of thesubscription data 142. Thetransport topic 134 may be a descriptive and/or numerical identifier that is detectable by thetransport engine 122. In some examples, thesubscription executor 116 identifies thetransport topic 134 using atopic library 135 that defines a plurality of transport topics. For example, thesubscription executor 116 may identify one of the plurality of transport topics in thetopic library 135 that corresponds to the query term(s) 144. In some examples, if thesubscription executor 116 cannot identify atransport topic 134 from thetopic library 135 using the query term(s) 144, thesubscription executor 116 may generate and send a response indicating that thequery subscription 141 has failed. In some examples, the data queryAPI 118 identifies thetransport topic 134 using thesubscription data 142. In some examples, the data queryexecutor 120 identifies thetransport topic 134 using thesubscription data 142. - In response to receipt of the
query subscription request 140, thesubscription executor 116 may generate asubscription identifier 136 based on thesubscription data 142. Thesubscription identifier 136 may be an identifier that identifies thequery subscription 141. In some examples, the data queryAPI 118 generates thesubscription identifier 136. In some examples, the data queryexecutor 120 generates thesubscription identifier 136. In some examples, thesubscription executor 116 may generate thesubscription identifier 136 based on the user identifier 146, the query term(s) 144 and/or other information included in thesubscription data 142 such as variables, operation name(s)), the authenticated user identifier, and/or the client application identifier. In some examples, thesubscription executor 116 is configured to serialize and hash thesubscription data 142 to generate thesubscription identifier 136. - The data query
API 118 is configured to transmit, over thenetwork 150, a subscription status response 152 to theclient application 126. The subscription status response 152 includes thetransport topic 134. In some examples, the subscription status response 152 includes thesubscription identifier 136. In some examples, the subscription status response 152 includes a status message indicating whether thequery subscription request 140 is successful. - Upon receipt of the subscription status response 152, the
client application 126 may generate and transmit asubscribe request 154, over thenetwork 150, to thetransport engine 122. Thesubscribe request 154 includes thetransport topic 134. In some examples, theclient application 126 uses thetransport topic 134 identified in the subscription status response 152 for thesubscribe request 154. In some examples, theclient application 126 identifies thetransport topic 134 using thesubscription data 142 in the same manner as thesubscription executor 116. In some examples, thesubscribe request 154 includes thesubscription identifier 136. In some examples, thesubscribe request 154 includes the user identifier 146. In some examples, theclient application 126 transmits thesubscribe request 154 in response to receipt of the subscription status response 152. In some examples, theclient application 126 transmits thesubscribe request 154 substantially in parallel with the transmission of thequery subscription request 140. In some examples, theclient application 126 sends thequery subscription request 140 and then sends thesubscribe request 154 within a period of less than 500 ms from the transmission of thequery subscription request 140. In some examples, theclient application 126 sends thequery subscription request 140 and then sends thesubscribe request 154 within a period of 100-200 ms after sending thequery subscription request 140. - In response to the
subscribe request 154, thetransport engine 122 establishes adelivery channel 125 with theclient application 126 to stream themessages 132 to theclient application 126. Thedelivery channel 125 is associated with thetransport topic 134 such thatmessages 132 delivered over thedelivery channel 125 correspond to thetransport topic 134. In some examples, thetransport engine 122 subscribes theclient application 126 to thetransport topic 134 corresponding to the user identifier 146 and the query term 144 (and/or a contributor identifier). Thedelivery channel 125 remains open and active while thequery subscription 141 is active. In some examples, thetransport engine 122 assigns a channel identifier to thedelivery channel 125. In some examples, thetransport engine 122 sends, over thenetwork 150, the channel identifier to theclient application 126. Theclient application 126 may periodically re-subscribe (e.g., every two-minutes) to thedelivery channel 125. Theclient application 126 may automatically send a re-subscribe request in response to the query being active (e.g., a visible search column is displayed on the user interface 128). If the query ends (e.g., a column is scrolled off the user interface 128), theclient application 126 may send a message to thetransport engine 122 to unsubscribe from thetransport topic 134, thereby closing thedelivery channel 125. -
FIG. 3 illustrates thesystem 100 depicting example operations of theevent producer system 106 and thesubscription executor 116 to configure thequery subscription 141 at theevent producer system 106 and receiveresponse events 156 from theevent producer system 106 according to an aspect.FIG. 4 illustrates thesystem 100 depicting example operations of thesubscription executor 116 and thetransport engine 122 to deliverdelivery events 160 to thetransport engine 122. - In response to receipt of the
query subscription request 140, the data queryAPI 118 generates and sends thequery subscription 141 to theevent producer manager 108. The data queryAPI 118 may send thequery subscription 141 as a thrift request to theevent producer manager 108. A thrift request may be a remote procedure call system that is used to communicate between various components of the messaging platform 104. Thequery subscription 141 includes the subscription data 142 (e.g., which may include the query term(s) 144), and the user identifier 146). In some examples, thequery subscription 141 includes thesubscription identifier 136. In some examples, thequery subscription 141 includes theexpiration time 148. In some examples, thequery subscription 141 sent to theevent producer manager 108 may include the user identifier 146 and other subscription related data to enable theevent producer system 106 to return them in theresponse events 156 to provide enough context to hydrate and route themessages 132 identified by theresponse events 156. Theevent producer manager 108 may use theexpiration time 148 to determine whether thequery subscription 141 has timed-out. For example, if the time has exceeded theexpiration time 148, theevent producer manager 108 may instruct theevent producer 110 to delete thequery subscription 141, thereby saving resources forother query subscriptions 141. - The
event producer manager 108 assigns thequery subscription 141 to an event producer 110 (or a group of event producers 110). In some examples, theevent producer manager 108 assigns thequery subscription 141 based on the user identifier 146. Thequery subscription 141 is stored at the event producer 110 (or eachevent producer 110 in the group). Theevent producer 110 generates theresponse events 156 such that aresponse event 156 is generated in response to a message from themessage stream 114 being determined as containing aquery term 144 of thequery subscription 141. Theevent producer 110 may publish theresponse events 156 to theresponse event bus 123. - In some examples, the
collector service 170 receives theresponse events 156 and publishes theresponse events 156 to theresponse event bus 132. In some examples, as discussed in greater detail later in the disclosure, thecollector service 170 may de-duplicateresponse events 156 relating to thesame message 132, discard one ormore response events 156 so that the streaming rate is below a threshold level, and/or periodically generate status messages about the health of thequery subscriptions 141 at theevent producer system 106. Eachresponse event 156 includes amessage identifier 158 that uniquely identifies themessage 132 matching thequery subscription 141. In some examples, eachresponse event 156 includes the subscription data 142 (e.g., query term(s) 144), and the user identifier 146). In some examples, eachresponse event 156 includes thesubscription identifier 136. In some examples, eachresponse event 156 includes only themessage identifier 158. - The
subscription executor 116 subscribes to theresponse event bus 123 to obtain theresponse events 156 published by theevent producer system 106. Generally, thesubscription executor 116 generates (e.g., hydrates) themessages 132 identified by themessage identifiers 158 and applies visibility rules before providing thefull messages 132 to thetransport engine 122. In some examples, hydration may refer to the creation of themessage 132 from themessage identifier 158 and the user identifier 146 such that the generatedmessage 132 has the format compatible with theclient application 126 and includes data corresponding to the perspective of the user identified by the user identifier 146. In some examples, thesubscription executor 116 is configured to generate a java script object notation (JSON) message (e.g., the full JSON message) based on themessage identifier 158 and the user identifier 146. As thesubscription executor 116 generates eachmessage 132 corresponding to arespective response event 156, thesubscription executor 116 published adelivery event 160 that includes themessage 132 to thedelivery event bus 121. - During message hydration, the
subscription executor 116 may discard aresponse event 156 if thesubscription executor 116 determines that themessage 132 identified by themessage identifier 158 violates a visibility rule, thereby improving the security of the messaging platform 104 while being able to deliver real-time messages 132 to theclient application 126. For example, if theresponse event 156 identifies amessage 132 authored by a user that restricted (e.g., blocked or muted) the user identified by the user identifier 146, thesubscription executor 116 may discard theresponse event 156. - The data query
executor 120 subscribes to theresponse event bus 123. The data queryexecutor 120 may monitor theresponse event bus 123 to obtain anyresponse events 156 published to theresponse event bus 123 by theevent producers 110. The data queryexecutor 120 may communicate with the data queryAPI 118 to generate themessage 132 in response to eachresponse event 156 obtained from theresponse event bus 123. In some examples, thedata query API 118 may receive both a query and an event and uses the event as the basis for the query execution. - For example, for a
response event 156, the data queryexecutor 120 may deliver themessage identifier 158 and subscription metadata (e.g., thesubscription data 142 and/or subscription identifier 136) to the data queryAPI 118. In some examples, the data queryexecutor 120 executes a thrift request to the data queryAPI 118 to deliver themessage identifier 158 and the subscription metadata. The data queryAPI 118 extracts data from themessage identifier 158 and the subscription metadata and executes theoriginal query subscription 141 against theresponse event 156 to generate the message 132 (e.g., the full JSON message). The data queryexecutor 120 receives the execution results (e.g., the message 132) from thedata query API 118 and publish adelivery event 160 on thedelivery event bus 121. As shown inFIG. 4 , thedelivery event 160 includes themessage 132. In some examples, thedelivery event 160 includestransport topic data 162 that identifies thetransport topic 134. - The
transport engine 122 subscribes to thedelivery event bus 121 to monitor and obtaindelivery events 160 published by the data queryexecutor 120. For example, when adelivery event 160 is published to thedelivery event bus 121, thetransport engine 122 obtains thedelivery event 160 and determines whichdelivery channel 125 to stream themessage 132 included within thedelivery event 160 based on a channel-topic mapping 164 that mapsdelivery channels 125 to transporttopics 134. For example, thetransport topic data 162 may identify thetransport topic 134 associated with themessage 132, and thetransport engine 122 may identify theappropriate delivery channel 125 to stream themessage 132 based on the channel-topic mapping 164. Thetransport engine 122 is configured to stream themessage 132 to theclient application 126 over thedelivery channel 125. -
FIG. 5 illustrates thesystem 100 depicting example operations of thetransport engine 122 formultiple delivery channels 125. For example, if theclient application 126 has establishedmultiple query subscriptions 141, thetransport engine 122 creates aseparate delivery channel 125 for eachactive query subscription 141 and then delivers thosemessages 132 over itsrespective delivery channel 125. For example, in response to aquery subscription 141 relating to the search term “dogs”, thetransport engine 122 transmits, over thenetwork 150, themessages 132 received from thesubscription executor 116 to theclient application 126 via a first delivery channel 125-1 (e.g., the “dogs” delivery channel). In response to anactive query subscription 141 relating to the search term “cats”, thetransport engine 122 transmits, over thenetwork 150, themessages 132 received from thesubscription executor 116 to theclient application 126 via a second delivery channel 125-2 (e.g., the “cats” communication channel). - Although the
client application 126 transmits two requests (e.g., thequery subscription request 140 and the subscribe request 154) to generate and receivemessages 132 to the messaging platform 104, in some examples, theclient application 126 may renew with one of thesubscription executor 116 or thetransport engine 122. In some examples, theclient application 126 renews with thetransport engine 122. For example, the subscription to thetransport topic 134 may expire after a time interval unless the subscription is renewed by the client application 126 (e.g. theclient application 126 must renew with thetransport engine 122 every period of time (e.g., every 2 minutes) or thequery subscription 141 expires). -
FIG. 6 illustrates thesystem 100 depicting example operations of a renew operation according to an aspect. In some examples, the subscription executor 116 (e.g., the data query executor 120) is configured manage subscription renews. For example, theclient application 126 may transmit, over thenetwork 150, a subscribe renewrequest 161 to thetransport engine 122 to renew the subscription to thetransport topic 134. In response to the subscribe renewrequest 161, thetransport engine 122 may providetransport topic data 162 to the data queryexecutor 120. Thetransport topic data 162 may include information about thetransport topic 134, thesubscription identifier 136, and/or information about whichevent producer 110 is assigned to generateresponse events 156 for the user identifier 146. In response to thetransport topic data 162, the data queryexecutor 120 may transmit a renewcall 171 to theevent producer system 106. - The
event producer manager 108 may receive the renewcall 171 and update theexpiration time 148 so that thequery subscription 141 is not deleted from theevent producers 110. In response to the renewcall 171, theevent producer manager 108 may publish a status message 166 to theresponse event bus 123, which is received by the data queryexecutor 120. The data queryexecutor 120 may publish the status message 166 on thedelivery event bus 121 so that thetransport engine 122 can deliver the status message 166 to theclient application 126. - The
computing device 124 may be a mobile computing device (e.g., a smart phone, a PDA, a tablet, or a laptop computer) or a non-mobile computing device (e.g., a desktop computing device). Thecomputing device 124 also includes various network interface circuitry, such as for example, a mobile network interface through which thecomputing device 124 can communicate with a cellular network, a Wi-Fi network interface with which thecomputing device 124 can communicate with a Wi-Fi base station, a Bluetooth network interface with which thecomputing device 124 can communicate with other Bluetooth devices, and/or an Ethernet connection or other wired connection that enables thecomputing device 124 to access thenetwork 150. - The
server computer 102 may be a single computing device or may be a representation of two or more distributed computing devices communicatively connected to share workload and resources. Theserver computer 102 may include at least one processor and a non-transitory computer-readable medium that stores executable instructions that when executed by the at least one processor cause the at least one processor to perform the operations discussed herein. -
FIG. 7 illustrates an example of theuser interface 728 of theclient application 126 ofFIG. 1 according to an aspect. The description ofFIG. 7 also references components and messages explained with reference toFIGS. 1 through 6 . In some examples, theclient application 126 is configured to display multiple timelines as separate columns. For example, the user may add or remove columns, thereby adding or removing timelines. In some examples, the addition of a column that specifies a search initiates aquery subscription 141. In some examples, the removal of a column causes thequery subscription 141 to expire. In some examples, the user may add a first column that provides a first timeline 730-1. The first timeline 730-1 may displaymessages 732 generated by a certain user (e.g., user A) while thequery subscription 141 remains active. For example, while the first column is displayed, anymessages 732 generated by user A are displayed on the first timeline 730-1. For example, user A may post amessage 732 to the messaging platform 104 at a certain time, and themessage 732 may be pushed to the first timeline 130-1 around the time that themessage 732 was posted such that the user can view the newly createdmessage 732 by user A in real-time or near real-time. In some examples, the first timeline 730-1 is rendered in chronological order so that the newly createdmessage 732 is pushed to the top of the first timeline 730-1. - In some examples, the user may add a second column that provides a second timeline 730-2 of
messages 732 that match the hashtag #GraphQL. For example, the addition of the second column indicating the search term “#GraphQL” initiates aquery subscription 141. The second timeline 730-2 may displaymessages 732 that include content having the search term “#GraphQL.” For example, while the second column is displayed, anymessages 732 exchanged on the messaging platform 104 that include the search term “#GraphQL” are streamed to the second timeline 730-2. In some examples, the second timeline 730-2 is rendered in chronological order so that a newly createdmessage 732 that includes the search term “#GraphQL” is pushed to the top of the second timeline 730-2. - In some example, the user may add a third column that provides a third timeline 730-3 of
messages 732 that include the search term “GraphQL Summit”. For example, the addition of the third column indicating the search term “GraphQL Summit” initiates aquery subscription 141. The third timeline 730-3 may displaymessages 732 that include content that match the search term “GraphQL Summit.” For example, while the third column is displayed, anymessages 732 that match the search term “GraphQL Summit” are streamed to the third timeline 730-3 while thequery subscription 141 remains active. In some examples, the third timeline 730-3 is rendered in chronological order so that a newly createdmessage 732 that includes the search term “GraphQL Summit” is pushed to the top of the third timeline 730-3. -
FIG. 8 illustrates aflowchart 800 depicting example operations of the messaging platform 104 for streaming real-time messages 132 according toquery subscriptions 141 according to an aspect. Theflowchart 800 is described with reference to thesystem 100 ofFIGS. 1 through 6 . -
Operation 802 includes transmitting, by asubscription executor 116, aquery subscription 141 to anevent producer system 106 in response to receipt of aquery subscription request 140 from aclient application 126. For example, thedata query API 118 may receive thequery subscription request 140 over thenetwork 150 from theclient application 126, and the data queryAPI 118 may generate thequery subscription 141. The data queryAPI 118 may send thequery subscription 141 to theevent producer manager 108. In some examples, thequery subscription request 140 is a GraphQL subscription query, where the data queryAPI 118 is a GraphQL API and the data queryexecutor 120 is a GraphQL executor. In some examples, thequery subscription request 140 includes aquery term 144 and a user identifier 146. In some examples, thedata query API 118 may identify atransport topic 134 in response to thequery subscription request 140. -
Operation 804 includes creating, by atransport engine 122, adelivery channel 125 between theclient application 126 and thetransport engine 122 in response to receipt of asubscribe request 154 received over thenetwork 150 from theclient application 126. For example, thetransport engine 122 may receive thesubscribe request 154 over thenetwork 150 from theclient application 126 and create thedelivery channel 125 in response to receipt of thesubscribe request 154. -
Operation 806 includes generating, at theevent producer system 106, aresponse event 156 in response to a message from amessage stream 114 having content that satisfies thequery subscription 141. For examples, theevent producer manager 108 may assign thequery subscription 141 to one ormore event producers 110, where eachevent producer 110 generates aresponse event 156 when a message from themessage stream 114 satisfies thequery subscription 141. -
Operation 808 includes determining, by thesubscription executor 116, whether an author of the message identified by theresponse event 156 has restricted (e.g., blocked or muted) a user associated with the user identifier 146, andoperation 810 includes discarding, by thesubscription executor 116, the message identified by theresponse event 156 in response to the user being determined as restricted by the author. For example, during message hydration, thesubscription executor 116 may discard aresponse event 156 if thesubscription executor 116 determines that themessage 132 identified by themessage identifier 158 violates a visibility rule, thereby improving the security of the messaging platform 104 while being able to deliver real-time messages 132 to theclient application 126. For example, if theresponse event 156 identifies amessage 132 authored by a user that restricted (e.g., blocked or muted) the user identified by the user identifier 146, thesubscription executor 116 may discard theresponse event 156 -
Operation 812 includes streaming, by thetransport engine 122, themessages 132 to a user interface 128 of theclient application 126 via thedelivery channel 125 during a period of time in which thequery subscription 141 is active in response to the user being determined as not restricted by the author. For example, as thetransport engine 122 receives thedelivery events 160, thetransport engine 122 streams the messages 132 (that do not violate visibility rules), over thenetwork 150, to theclient application 126. -
FIG. 9 illustrates aflowchart 900 depicting example operations of theclient application 126 for generating an active query on the messaging platform 104 and receiving a stream ofmessages 132 that match the active query according to an aspect. Theflowchart 800 is described with reference to thesystem 100 ofFIGS. 1 through 6 . -
Operation 902 includes transmitting, by aclient application 126, aquery subscription request 140, over anetwork 150, to asubscription executor 116 of the messaging platform 104, where thequery subscription request 140 is configured to cause thesubscription executor 116 to generate aquery subscription 141 to be executed on amessage queue 112 of messages exchanged on the messaging platform 104. -
Operation 904 includes transmitting, by theclient application 126, asubscribe request 154, over thenetwork 150, to atransport engine 122 of the messaging platform 104, where thesubscribe request 154 is configured to cause thetransport engine 122 to create adelivery channel 125 between thetransport engine 122 and theclient application 126. -
Operation 906 includes receiving, by theclient application 126, a stream ofmessages 132 that satisfy criteria of thequery subscription 141 via thedelivery channel 125 such that themessages 132 are streamed on a user interface 128 of theclient application 126 over time while thequery subscription 141 is active. -
Operation 908 includes periodically transmitting, by theclient application 126, a subscribe renewrequest 161, over thenetwork 150, to thetransport engine 122, where the subscribe renewrequest 161 configured to cause thetransport engine 122 to renew thedelivery channel 125 and cause thesubscription executor 116 to renew thequery subscription 141. - For example, in response to the subscribe renew
request 161, thetransport engine 122 may provide thetransport topic data 162 to the data queryexecutor 120. In response to thetransport topic data 162, the data queryexecutor 120 may transmit the renewcall 171 to theevent producer system 106. Theevent producer manager 108 may receive the renewcall 171 and update theexpiration time 148 so that thequery subscription 141 is not deleted from theevent producers 110. In response to the renewcall 171, theevent producer manager 108 may publish a status message 166 to theresponse event bus 123, which is received by the data queryexecutor 120. The data queryexecutor 120 may publish the status message 166 on thedelivery event bus 121 so that thetransport engine 122 can deliver the status message 166 to theclient application 126. As such, theclient application 126 may renew with only thetransport engine 122, and, as described below, the structure of the messaging platform 104 may cause thequery subscription 141 to be renewed at thetransport engine 122 and thesubscription executor 116, thereby decreasing the amount of communication transmitted between theclient application 126 and the messaging platform 104 to maintain thequery subscription 141. -
FIG. 10A is a schematic diagram of asystem 1000 including amessaging platform 1004 executable by one ormore server computers 1002, and aclient application 1026 executable by acomputing device 1024 according to an aspect. Themessaging platform 1004 is configured to stream, over anetwork 1050, real-time messages 1032 to aclient application 1026 according toquery subscriptions 1041 that match content from alarge message stream 1014 of messages exchanged on themessaging platform 1004. Themessaging platform 1004 includes anevent producer system 1006, amessage queue 1012 having amessage stream 114, asubscription executor 1016, and atransport engine 1022.FIG. 10B illustrates theevent producer system 1006 in greater detail. Thesystem 1000 may be an example of thesystem 100 ofFIGS. 1 through 6 and may include any of the features discussed with reference to the previous figures. - The
event producer system 1006 includes anevent producer manager 1008,event producers 1010 communicatively connected to theevent producer manager 1008, and acollector service 1070 communicatively connected to theevent producers 1010. Theevent producer manager 1008 obtainquery subscriptions 1041 and configured theevent producers 1010 to match content from amessage stream 1014 according to the criteria of thequery subscriptions 1041. - In some examples, the
event producer manager 1008 is an API configured to receive aquery subscription 1041 via a thrift request. In some examples, theevent producer manager 1008 is configured to receive aquery subscription 1041 from thesubscription executor 1016. Thequery subscription 1041 may define criteria that is used to identify messages from themessage stream 1014. In some examples, thequery subscription 1041 is a GraphQL query subscription. Thequery subscription 1041 includes subscription data that provides information about thequery subscription 1041. In some examples, thequery subscription 1041 includes one or more query terms, a user identifier, an expiration time, and/or a subscription identifier. - The
event producers 1010 are arranged inevent producer groups 1013 to execute a relatively large number ofquery subscriptions 1041 against themessage stream 1014. For example, theevent producer system 1006 may include a plurality ofevent producer groups 1013 such as a first event producer group 1013-1, a second event producer group 1013-2, a third event producer group 1013-3, and a fourth event producer group 1013-4. Although fourevent producer groups 1013 are illustrated inFIG. 10B , theevent producer groups 1013 may include any number ofevent producer groups 1013. Eachevent producer group 1013 is configured to receive thefull message stream 1014. In other words, eachevent producer group 1013 is configured to independently monitor thefull message stream 1014. Eachevent producer group 1013 includes a plurality ofevent producers 1010. AlthoughFIG. 10B illustrates fourevent producers 1010 within eachevent producer group 1013, eachevent producer group 1013 may include any number ofevent producers 1010, which may be the same or different numbers acrossevent producer groups 1013. - Each
event producer 1010 within a respectiveevent producer group 1013 may receive a separate portion of themessage stream 1014. For example, themessage stream 1014 is divided (e.g., equally divided or unequally divided) among theevent producers 1010 within a particularevent producer group 1013. For example, if there are fourevent producers 1010 within the first event producer group 1013-1, a first event producer receives a first portion of themessage stream 1014, a second event producer receives a second portion of themessage stream 1014, a third event producer receives a third portion of themessage stream 1014, and a fourth event producer receives a fourth portion of themessage stream 1014, where the first through fourth portions cover theentire message stream 1014. - Each
event producer group 1013 is allocated a portion of thequery subscriptions 1041. For example, if there are one hundredquery subscriptions 1041, twenty-fivequery subscriptions 1041 may be allocated to the first event producer group 1013-1, twenty-fivequery subscriptions 1041 may be allocated to the second event producer group 1013-2, twenty-fivequery subscriptions 1041 may be allocated to the third event producer group 1013-3, and twenty-fivequery subscriptions 1041 may be allocated to the third event producer group 1013-3. However, it is noted that the number ofquery subscriptions 1041 may be in the thousands or millions. - The
event producer manager 1008 may receive thequery subscription 1041 and assign thequery subscription 1041 to at least one of theevent producer groups 1013. In some examples, theevent producer manager 1008 assigns thequery subscription 1041 to anevent producer group 1013 based on a user identifier of thequery subscription 1041. In some examples, theevent producer manager 1008 is configured to execute a modulo operation using the user identifier and assign thequery subscription 1041 based on the results of the modulo operation. Thequery subscription 1041 is stored at each of theevent producers 1010 within the assignedevent producer group 1013. - In some examples, the
event producer manager 1008 assigns thequery subscription 1041 to twoevent producer groups 1013, e.g., a primary event producer group and a second event producer group. For example, theevent producer manager 1008 may assign thequery subscription 1041 to the first event producer group 1013-1 and the third event producer group 1013-3, where each of theevent producers 1010 within the first event producer group 1013-1 and the third event producer group 1013-3 stores thequery subscription 1041 in memory. In this manner, if one of theevent producer groups 1013 is fails, thequery subscription 1041 can still be executed by the otherevent producer group 1013 assigned to thequery subscription 1041. - In some examples, the
event producer manager 1008 is configured to monitor the number ofquery subscriptions 1041 being assigned and executed for eachevent producer group 1013 and configured to increase and/or decrease the number ofevent producer groups 1013 and/or the number ofevent producers 1010 within eachevent producer group 1013. For instance, in response to the number ofevent producers 1010 in a particularevent producer group 1013 being increased, eachindividual event producer 1010 may receive fewer messages from themessage stream 1014 to process and consequently may have more computational capacity to handle extra searches. In response to the number ofevent producer groups 1013 being increased, the number of search terms allocated to theevent producer 1010 may be reduced. - Each
event producer 1010 is configured to generate aresponse event 156 in response to thequery subscription 1041 being matched against a message from the respective portion of themessage stream 1014. As shown with respect to the previous figures, eachresponse event 156 includes a message identifier and subscription data providing information about thequery subscription 1041. Also, eachevent producer 1010 is configured to periodically generatestatus responses 1075 that indicate a health status of thequery subscription 1041 at arespective event producer 1010. Eachstatus response 1075 may indicate whether there is an error associated with executing thequery subscription 1041. For example, astatus response 1075 may indicate a fail status indicating that there is an error with processing thequery subscription 1041 at aparticular event producer 1010, or thestatus response 1075 may indicate an ok status indicating that thequery subscription 1041 is properly functioning at theparticular event producer 1010. - As indicated above, in some examples, the
query subscription 1041 is associated with an expiration time. In some examples, theevent producer manager 1008 is configured to monitor the amount of time that thequery subscription 1041 is active at the assignedevent producers 1010, and if the time exceeds the value specified by the expiration time, theevent producer manager 1008 may de-activate thequery subscription 1041 by instructions the assignedevent producers 1010 to delete thequery subscription 1041 from memory, thereby saving resources at theevent producer system 1006. However, theevent producer manager 1008 may receive the renew call before the expiration time expires, which renews the expiration time, thereby renewing thequery subscription 1041. - The
collector service 1070 is configured to receive theresponse events 1056 from theevent producers 1010 and publish theresponse events 1056 to aresponse event bus 1023. In some examples, thecollector service 1070 may determine whether the message identified by the response event has already been published to theresponse event bus 1023, and then discard theresponse event 1056 in response to the message being determined as already been published to theresponse event bus 1023 to avoid the duplication of messages sent to the client application. In some examples, thecollector service 1070 may determine whether a number ofresponse events 1056 within a period of time (e.g., one second) has exceeded a streaming rate threshold, and discard one or more response events 1056 (e.g., not publish one ormore response events 1056 on the response event bus 123). - Also, the
collector service 1070 is configured to receive thestatus responses 1075 from theevent producers 1010 and periodically send a status message 1066 (e.g., fail, ok, and/or renew) by publishing the status message on theresponse event bus 1023. If the status message 1066 indicates an error, theclient application 1026 may be required to transmit the query subscription request and the subscribe request to re-start thequery subscription 1041. For example, thecollector service 1070 may receive thestatus responses 1075 from theevent producers 1010, determine the health status of thequery subscription 1041 based on thestatus responses 1075, and initiate the transmission of a status message indicating the health status of thequery subscription 1041. -
FIG. 11 illustrates an example of acollector service 1170 according to an aspect. Thecollector service 1170 may be an example of thecollector service 1070 ofFIG. 10B and may include any of the features discussed with reference to the previous figures. Thecollector service 1170 may operate in conjunction with amemory cache 1180 before publishing theresponse events 1056 to theresponse event bus 1023 to de-duplicatemessages 1032 identified by theresponse events 1056 and/or decrease a streaming rate so that themessages 1032 are delivered to theclient application 1026 below astreaming rate threshold 1173. In addition, thecollector service 1170 may operate in conjunction with thememory cache 1180 to determine the health status of thequery subscription 1041 to provide a status message 1066 to theclient application 1026 or attempt to restart thequery subscription 1041. - The
collector service 1170 may include a de-duplicator 1172 configured to de-duplicateresponse events 1056 that identifymessages 1032 already delivered to theclient application 1026. In some examples, thequery subscription 1041 is assigned to two event producer groups 1013 (each of which receives the full message stream 1014) to protect against an event producer failure, which may theevent producers 1010 to identifyduplicate messages 1032. However, the de-duplicator 1172 is configured to identify duplicates so that the same message is not provided to theclient application 1026 multiple times. - As the
collector service 1170 publishes aresponse event 1056 to theresponse event bus 1023, thecollector service 1170 stores theresponse event 1056 in thememory cache 1180. In response to receipt of anew response event 1056, the de-duplicator 1172 determines whether a message identifier of thenew response event 1056 is stored in thememory cache 1180 by querying thememory cache 1180. In response to the message identifier not being stored in the memory cache 1180 (e.g., indicating that it is not a duplicate), thecollector service 1170 publishes thenew response event 1056 on theresponse event bus 1023 and stores thenew response event 1056 in thememory cache 1180. In response to the message identifier of thenew response event 1056 being stored in the memory cache 1180 (e.g., indicating that it is a duplicate), the de-duplicator 1172 is configured to discard thenew response event 1056. - The
collector service 1170 may include a status message handler 1174 configured to determine a health status for thequery subscription 1041 by querying thestatus responses 1075 in thememory cache 1180. For example, thecollector service 1170 may receive periodically thestatus responses 1075 from theevent producers 1010 and store thestatus responses 1075 in thememory cache 1180. The status message handler 1174 may periodically query thememory cache 1180 to obtain thestatus responses 1075 from thememory cache 1180 from the assignedevent producers 1010 for aparticular query subscription 1041, and then transmit a status message 1066 by publishing the status message 10066 on theresponse event bus 123. In some examples, if one or more of thestatus responses 1075 indicate a fail status, the status message 1066 may indicate a fail status, which may require theclient application 1026 to re-generate the query subscription 1041 (e.g., it may be required to transmit the query subscription request and the subscribe request). If most or all of thestatus responses 1075 indicate an ok status, the status message 1066 may indicate an ok status. - In some examples, the
collector service 1170 includes asubscription restarter 1176 configured to restart thequery subscription 1041 at theevent producers 1010. If thestatus responses 1075 indicate that there was an error with thequery subscription 1041 at one or more of theevent producers 1010, thesubscription restarter 1176 may determine whether thequery subscription 1041 is repairable based on subscription data associated with theresponse events 1056, and, if so, thesubscription restarter 1176 may transmit the subscription data to the one ormore event producers 110 reportingnegative status responses 1075. - In some examples, the
collector service 1170 includes aquota checker 1178 configured to discard one or more of theresponse events 1056 to control a streaming rate at whichmessages 1032 identified by theresponse events 1056 are delivered to theclient application 1026 to be equal to or less than astreaming rate threshold 1173. In some examples, thestreaming rate threshold 1173 is a value in a range of three messages per second to 20 messages per second. In some examples, thestreaming rate threshold 1173 is 10 messages per second. In some examples, thequota checker 1178 is configured to discard anew response event 1056 in response to a number of previously-receivedresponse events 1056 exceeding a threshold amount over a period of time (e.g., thenew response event 1056 is the eleventh message in one second and the threshold is ten messages per second). However, if the number of previously-recitedresponse events 1056 is equal to or less than a threshold amount over a period of time, thecollector service 1170 may publish thenew response event 1056 to theresponse event bus 1023. - As indicated above, the
collector service 1170 may publish theresponse events 1056 to theresponse event bus 1023 and store the publishedresponse events 1056 in thememory cache 1180. In response to anew response event 1056, thequota checker 1178 may query thememory cache 1180 to determine the number ofresponse events 1056 stored at thememory cache 1180 over a period of time, and then discard thenew response event 1056 in response to the number ofresponse events 1056 stored in thememory cache 1180 exceeding a threshold amount over a period of time. - In some examples, the
quota checker 1178 is configured to receiveengagement probability metrics 1177 formessages 1032 identified by theresponse events 156, where theengagement probability metrics 1177 indicate predicted levels of engagement with themessages 1032. Thequota checker 1178 is configured to discard one ormore response events 1056 based on theengagement probability metrics 1177 such that the streaming rate is equal to or less than thestreaming rate threshold 1173. For example, users may engage with themessages 1032 by favoritizing, re-sharing, and/or commenting on themessages 1032, which may be considered positive outcomes. In some examples, themessaging platform 1004 may include machine-learning resources that predict the level of positive engagement withmessages 1032 to be delivered to the user (e.g., how likely will the user engage (e.g., favoritize, re-share, and/or comment) with the message 1032), and thequota checker 1178 may receive thoseengagement probability metrics 1177. If anengagement probability metric 1177 for aparticular message 1032 is below a threshold level, thequota checker 1178 may discard thatmessage 1032 in order to control the streaming rate. In some examples, theengagement probability metrics 1177 includes predicted negative outcomes, e.g., the probability that the user might find themessage 1032 abusive. In these examples, based on theengagement probability metrics 1177, thequota checker 1178 may discard themessages 1032 having a higher likely of being considered as abusive (e.g., containing abusive content). - In some examples, the
quota checker 1178 is configured to receivemessage health metrics 1179 formessages 1032 identified by theresponse events 1056, where themessage health metrics 1179 indicate risk levels of violating one or more conditions of the messaging platform 1004 (e.g., abusive behavior, hateful conduct, threats, etc.). Thequota checker 1178 is configured to discard one ormore response events 1056 based on themessage health metrics 1179 such that the streaming rate is equal to or less than thestreaming rate threshold 1173. -
FIG. 12 illustrates an example of thecollector service 1270 according to an aspect. Thecollector service 1270 may be example of thecollector service 1170 ofFIG. 11 and may include any of the features described with reference to the previous figures. Thecollector service 1270 may include a plurality ofcollector service instances 1271 such as a first collector service instance 1271-1, a second collector service instance 1271-2, and a third collector service instance 1271-3. Although threecollector service instances 1271 are illustrated inFIG. 12 , thecollector service 1270 may include any number ofcollector service instances 1271. Eachcollector service instance 1271 may receive a separate portion of theresponse events 1056 and/or thestatus responses 1075. For example, the first collector service instance 1271-1 may receive a first portion of theresponse events 1056 and/or thestatus responses 1075, the second collector service instance 1271-2 may receive a second portion of theresponse events 1056 and/or thestatus responses 1075, and the third collector service instance 1271-3 may receive a third portion of theresponse events 1056 and/or thestatus responses 1075. Eachcollector service instance 1271 may be a separate instance of thecollector service 1170 ofFIG. 11 . For example, eachcollector service instance 1271 may perform any of the operations of thecollector service 1170 ofFIG. 11 . For example, each of thecollector service instance 1271 may include the functionalities of the de-duplicator 1172, the status message handler 1174, thesubscription restarter 1176, and/or thequota checker 1178. - In some examples, the
collector service 1270 is configured to perform a two-layer streaming rate adjustment process. For example, with respect to the first layer, eachcollector service instance 1271 may receive a separate portion of theresponse events 1056 and obtain a subset ofresponse events 1056 by discarding one ormore response events 1056 such that each subset includes a number of response events 10056 that is equal to or less than an individualstreaming rate threshold 1284. With respect to the second layer, eachcollector service instance 1271 stores its subset in thememory cache 1180, and at least one of thecollector service instances 1271 aggregates the subsets and discards one ormore response events 1056 from the aggregated subsets such that the aggregated subsets include a number ofresponse events 1056 that is equal to or less than thestreaming rate threshold 1173. - In further detail, with respect to the first layer, the first collector service instance 1271-1 may receive the first portion of the
response events 1056 and obtain a first subset of thoseresponse events 1056 by discarding one ormore response events 1056 to provide a streaming rate equal to or less than the individualstreaming rate threshold 1284. If the individual streaming rate threshold is four messages per second, the first collector service instance 1271-1 discards any messages beyond four within one second and stores the first subset in thememory cache 1180. The second collector service instance 1271-2 may receive the second portion of theresponse events 1056 and obtain a second subset of thoseresponse events 1056 by discarding one ormore response events 1056 to provide a streaming rate equal to or less than the individualstreaming rate threshold 1284. If the individual streaming rate threshold is four messages per second, the second collector service instance 1271-2 discards any messages beyond four within one second and stores the second subset in thememory cache 1180. Similarly, the third collector service instance 1271-3 may receive the third portion of theresponse events 1056 and obtain a third subset of thoseresponse events 1056 by discarding one ormore response events 1056 to provide a streaming rate equal to or less than the individualstreaming rate threshold 1284. If the individual streaming rate threshold is four messages per second, the third collector service instance 1271-3 discards any messages beyond four within one second and stores the third subset in thememory cache 1180. - At this point, the total number of messages is twelve, and the
streaming rate threshold 1173 may be ten messages per second. With respect to the second layer, at least one of thecollector service instances 1271 aggregates the first, second, and third subsets and discards one ormore response events 1056 from the aggregated subsets such that the aggregated subsets include a number ofresponse events 1056 that is equal to or less than thestreaming rate threshold 1173. If thestreaming rate threshold 1173 is ten messages per second, at least one of thecollector service instances 1271 discards tworesponse events 156 and publishes tenresponse events 1056 to theresponse event bus 1023. - In some examples, the
collector service 1270 is configured to perform a two-layer de-duplication process. For example, with respect to the first layer, eachcollector service instance 1271 may receive a separate portion of theresponse events 156 and remove anyresponse events 1056 identifying thesame message 1032. Eachcollector service instance 1271 may store its respective group of theresponse events 1056 in thememory cache 1180. At least one of thecollector service instances 1271 may query thememory cache 1180 to aggregates the groups and discard anyresponse events 1056 that identify thesame message 1032 from the aggregated groups. -
FIG. 13 illustrates aflowchart 1300 depicting example operations of thesystem 1000 according to an aspect. Although the flowchart is discussed with reference to thesystem 1000 ofFIGS. 10A and 10B , the operations ofFIG. 13 may be applicable to any of the systems discussed herein. -
Operation 1302 includes receiving, by anevent producer manager 1008, aquery subscription 1041 to match content in amessage queue 1012 that includes amessage stream 114 of messages exchanged on amessaging platform 1004 executable by aserver computer 1002, where themessaging platform 1004 configured to delivermessages 1032 to a user interface of aclient application 1026 executable by a computing device. 1024 -
Operation 1304 includes assigning, by theevent producer manager 1008, thequery subscription 1041 to anevent producer group 1013 of a plurality ofevent producer groups 1013, where eachevent producer group 1013 is configured to receive themessage stream 1014 of messages from themessage queue 1012, eachevent producer group 1013 includes a plurality ofevent producers 1010, and eachevent producer 1010 configured to receive a separate portion of themessage stream 1014 of messages. -
Operation 1306 includes generating, by anindividual event producer 1010, aresponse event 1056 in response to a message from the respective portion of themessage stream 114 of messages including a query term of thequery subscription 1041. -
Operation 1308 includes publishing, by acollector service 1070, theresponse event 1056 to aresponse event bus 1023, where theresponse event 1056 includes a message identifier for themessage 1032 to be delivered to theclient application 1026. -
FIG. 14 illustrates aflowchart 1400 depicting example operations of thesystem 1000FIGS. 10A and 10B with thecollector service 1170 ofFIG. 11 and/or thecollector service 1270 ofFIG. 12 according to an aspect. However, the operations ofFIG. 14 may be applicable to any of the systems discussed herein -
Operation 1402 includes receiving amessage stream 1014 of messages exchanged on amessaging platform 1004 executable by aserver computer 1002, where themessaging platform 1004 is configured to delivermessages 1032 to a user interface of aclient application 1026 executable by acomputing device 1024. -
Operation 1404 includes receiving aquery subscription 1041 for an active query on themessaging platform 1004. -
Operation 1406 includes generatingresponse events 1056 while thequery subscription 1041 is active such that aresponse event 1056 is generated in response to a message of themessage stream 1014 of messages including a query term of thequery subscription 1041. -
Operation 1408 includes discarding one or more of theresponse events 1056 to control a streaming rate at which messages identified by theresponse events 1056 are delivered to theclient application 1026 to be equal to or less than astreaming rate threshold 1173. -
Operation 1410 includes delivering, over anetwork 1050, themessages 1032 to theclient application 1026 in a manner that is equal to or less than thestreaming rate threshold 1173. - In the above description, numerous details are set forth. It will be apparent, however, to one of ordinary skill in the art having the benefit of this disclosure, that implementations of the disclosure may be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the description.
- Some portions of the detailed description are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here and generally, conceived to be a self-consistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
- It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the above discussion, it is appreciated that throughout the description, discussions utilizing terms such as “identifying,” “determining,” “calculating,” “updating,” “transmitting,” “receiving,” “generating,” “changing,” or the like, refer to the actions and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (e.g., electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
- Implementations of the disclosure also relate to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a non-transitory computer readable storage medium, such as, but not limited to, any type of disk including floppy disks, optical disks, CD-ROMs and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, flash memory, or any type of media suitable for storing electronic instructions.
- The words “example” or “exemplary” are used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “example’ or “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects or designs. Rather, use of the words “example” or “exemplary” is intended to present concepts in a concrete fashion. As used in this application, the term “or” is intended to mean an inclusive “or” rather than an exclusive “or”. That is, unless specified otherwise, or clear from context, “X includes A or B” is intended to mean any of the natural inclusive permutations. That is, if X includes A; X includes B; or X includes both A and B, then “X includes A or B” is satisfied under any of the foregoing instances. In addition, the articles “a” and “an” as used in this application and the appended claims should generally be construed to mean “one or more” unless specified otherwise or clear from context to be directed to a singular form. Moreover, use of the term “an implementation” or “one embodiment” or “an implementation” or “one implementation” throughout is not intended to mean the same embodiment or implementation unless described as such. Furthermore, the terms “first,” “second,” “third,” “fourth,” etc. as used herein are meant as labels to distinguish among different elements and may not necessarily have an ordinal meaning according to their numerical designation.
- The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct a more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description below. In addition, the present disclosure is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the disclosure as described herein.
- The above description sets forth numerous specific details such as examples of specific systems, components, methods and so forth, in order to provide a good understanding of several implementations of the present disclosure. It will be apparent to one skilled in the art, however, that at least some implementations of the present disclosure may be practiced without these specific details. In other instances, well-known components or methods are not described in detail or are presented in simple block diagram format in order to avoid unnecessarily obscuring the present disclosure. Thus, the specific details set forth above are merely examples. Particular implementations may vary from these example details and still be contemplated to be within the scope of the present disclosure.
Claims (20)
1. A method comprising:
receiving, from a user device, a query subscription to match content in a plurality of messages posted to a messaging platform;
in response to a message of the plurality of messages satisfying the query subscription, generating a response event while the query subscription is active, the response event including a message identifier that identifies the message;
determining whether a user associated with the query subscription has restricted an author of the message identified by the response event;
in response to the author being determined as restricted by the user, discarding the response event;
in response to the author being determined as not restricted by the user, generating the message using the message identifier; and
transmitting, over a network, the message to the user device.
2. The method of claim 1 , wherein the message includes a Java script object notation (JSON) message, wherein the JSON message is generated after the response event is generated.
3. The method of claim 1 , wherein determining whether the user has restricted the author includes determining whether the user has blocked or muted the author.
4. The method of claim 1 , wherein generating the message includes obtaining content of the message from a message repository using the message identifier.
5. The method of claim 1 , further comprising:
assigning the query subscription to one or more of a plurality of event producers; and
adjusting an amount of the plurality of event producers based on how many active query subscriptions are being processed at the plurality of event producers and how many messages are posted to the messaging platform over a period of time.
6. The method of claim 1 , further comprising:
determining whether a number of response events within a period of time has exceeded a streaming rate threshold; and
discarding one or more response events in response to the streaming rate threshold being exceeded.
7. The method of claim 1 , further comprising:
receiving, over a network, a query subscription request from the user device; and
transmitting the query subscription to an event producer manager in response to receipt of the query subscription request, the event producer manager configured to assign the query subscription to one or more event producers.
8. An apparatus comprising:
at least one processor; and
a non-transitory computer-readable medium storing executable instructions that when executed by the at least one processor cause the at least one processor to:
receive, from a user device, a query subscription to match content in a plurality of messages posted to a messaging platform;
in response to a message of the plurality of messages satisfying the query subscription, generate a response event while the query subscription is active, the response event including a message identifier that identifies the message;
determine whether a user associated with the query subscription has restricted an author of the message identified by the response event;
in response to the author being determined as restricted by the user, discard the response event;
in response to the author being determined as not restricted by the user, generate the message using the message identifier included within the response event; and
transmit, over a network, the message to the user device.
9. The apparatus of claim 8 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
assign the query subscription to one or more of a plurality of event producers, each event producer being configured to determine whether at least a portion of the plurality of messages satisfy the query subscription.
10. The apparatus of claim 9 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
receive response events from the plurality of event producers and publish the response events on a response event bus;
receive a status message about a status of execution of the query subscription at a respective event producer; and
transmit subscription data stored on the messaging platform to the respective event producer to restart the query subscription in response to the status message indicating an error associated with the query subscription.
11. The apparatus of claim 9 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
monitor a number of query subscriptions processed at the plurality of event producers and a size of the plurality of messages; and
adjust a number of the plurality of event producers based on the number of query subscriptions and the size of the plurality of messages.
12. The apparatus of claim 8 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
assign the query subscription to a first event producer group and a second event producer group, the first event producer group including a plurality of event producers, each of the plurality of event producers configured to receive a separate portion of the plurality of messages.
13. The apparatus of claim 8 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
receive, over the network, a query subscription request from the user device; and
transmit the query subscription to an event producer manager in response to receipt of the query subscription request, the event producer manager configured to assign the query subscription to one or more event producers.
14. The apparatus of claim 13 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
identify a transport topic in response to receipt of the query subscription request; and
transmit, over the network, a subscription status response to the user device, the subscription status response identifying the transport topic.
15. The apparatus of claim 14 , wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
receive, over the network, a subscribe request from the user device, the subscribe request identifying the transport topic; and
establish a delivery channel between a transport engine and the user device in response to receipt of the subscribe request and associate the delivery channel with the transport topic identified in the subscribe request such that messages transmitted via the delivery channel correspond to subject matter of the transport topic.
16. A non-transitory computer-readable medium storing executable instructions that when executed by at least one processor cause the least one processor to execute operations, the operations comprising:
receiving, from a user device, a query subscription to match content in a plurality of messages posted to a messaging platform;
in response to a message of the plurality of messages satisfying the query subscription, generating a response event while the query subscription is active, the response event including a message identifier that identifies the message;
determining whether a user associated with the query subscription has restricted an author of the message identified by the response event;
in response to the author being determined as restricted by the user, discarding the response event;
in response to the author being determined as not restricted by the user, generating the message using the message identifier; and
transmitting, over a network, the message to the user device.
17. The non-transitory computer-readable medium of claim 16 , wherein the message includes a Java script object notation (JSON) message, wherein the JSON message is generated after the response event is generated.
18. The non-transitory computer-readable medium of claim 16 , wherein determining whether the user has restricted the author includes determining whether the user has blocked or muted the author.
19. The non-transitory computer-readable medium of claim 16 , wherein generating the message includes obtaining content of the message from a message repository using the message identifier.
20. The non-transitory computer-readable medium of claim 16 , wherein the operations further comprise:
assigning the query subscription to one or more of a plurality of event producers; and
adjusting an amount of the plurality of event producers based on how many active query subscriptions are being processed at the plurality of event producers and how many messages are posted to the messaging platform over a period of time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/815,010 US20220365978A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US201962883633P | 2019-08-06 | 2019-08-06 | |
US16/668,811 US11429669B2 (en) | 2019-08-06 | 2019-10-30 | Managing query subscription renewals in a messaging platform |
US17/815,010 US20220365978A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/668,811 Continuation US11429669B2 (en) | 2019-08-06 | 2019-10-30 | Managing query subscription renewals in a messaging platform |
Publications (1)
Publication Number | Publication Date |
---|---|
US20220365978A1 true US20220365978A1 (en) | 2022-11-17 |
Family
ID=74498803
Family Applications (5)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/668,811 Active 2040-07-16 US11429669B2 (en) | 2019-08-06 | 2019-10-30 | Managing query subscription renewals in a messaging platform |
US16/669,044 Active US11580165B2 (en) | 2019-08-06 | 2019-10-30 | Event producer system of a messaging platform for delivering real-time messages |
US17/815,014 Abandoned US20220365979A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
US17/815,010 Abandoned US20220365978A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
US17/815,017 Abandoned US20220358167A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
Family Applications Before (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/668,811 Active 2040-07-16 US11429669B2 (en) | 2019-08-06 | 2019-10-30 | Managing query subscription renewals in a messaging platform |
US16/669,044 Active US11580165B2 (en) | 2019-08-06 | 2019-10-30 | Event producer system of a messaging platform for delivering real-time messages |
US17/815,014 Abandoned US20220365979A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/815,017 Abandoned US20220358167A1 (en) | 2019-08-06 | 2022-07-26 | Managing query subscription renewals in a messaging platform |
Country Status (9)
Country | Link |
---|---|
US (5) | US11429669B2 (en) |
EP (1) | EP3999961A1 (en) |
JP (2) | JP2022538365A (en) |
KR (2) | KR102498752B1 (en) |
CN (2) | CN114270344A (en) |
AU (2) | AU2020325362B2 (en) |
BR (1) | BR112022001683A2 (en) |
CA (1) | CA3150018A1 (en) |
WO (1) | WO2021026553A1 (en) |
Families Citing this family (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9860153B2 (en) * | 2014-12-23 | 2018-01-02 | Intel Corporation | Technologies for protocol execution with aggregation and caching |
US11429669B2 (en) * | 2019-08-06 | 2022-08-30 | Twitter, Inc. | Managing query subscription renewals in a messaging platform |
CN112787970B (en) * | 2019-11-01 | 2024-04-16 | 华为技术有限公司 | Method and device for subscribing event stream |
US11422855B2 (en) * | 2020-04-27 | 2022-08-23 | Bank Of America Corporation | Data set subscription tracking and termination system |
US11838247B2 (en) * | 2020-06-09 | 2023-12-05 | Jpmorgan Chase Bank, N.A. | Method and system for interaction servicing |
US11663211B2 (en) * | 2020-09-29 | 2023-05-30 | Atlassian Pty Ltd. | Data retrieval systems and methods |
US11595248B2 (en) * | 2020-12-22 | 2023-02-28 | Vmw Are, Inc. | Scalable notification delivery for networked computing environments |
US11790104B2 (en) * | 2021-02-18 | 2023-10-17 | Glean Technologies, Inc. | Permissions-aware search with document verification |
US11995135B2 (en) * | 2021-02-18 | 2024-05-28 | Glean Technologies, Inc. | Permissions-aware search with user suggested results |
CN113032419B (en) * | 2021-04-21 | 2022-08-30 | 上海微盟企业发展有限公司 | Multi-source data aggregation search method, device, equipment and storage medium |
US11989188B2 (en) * | 2021-08-25 | 2024-05-21 | Bank Of America Corporation | Aggregating access to third party data sources and intelligently managing access through request quotas |
CN115037614B (en) * | 2022-06-08 | 2024-03-19 | 中国电信股份有限公司 | Management and control rule adaptation method and device, and electronic equipment |
CN114911802B (en) * | 2022-06-08 | 2024-09-20 | 四三九九网络股份有限公司 | Method for inquiring user characteristics by client in real time |
CN114785861B (en) * | 2022-06-22 | 2022-12-13 | 飞狐信息技术(天津)有限公司 | Service request forwarding system, method, computer equipment and storage medium |
CN115134320B (en) * | 2022-08-25 | 2023-01-03 | 四川汉唐云分布式存储技术有限公司 | Transaction system for determining time sequence based on message distribution |
US11709660B1 (en) * | 2022-10-12 | 2023-07-25 | Stodge Inc. | Integrated third-party application builder trigger for message flow |
US12255860B2 (en) | 2022-10-12 | 2025-03-18 | Stodge Inc. | Integrated third-party application builder trigger for message flow |
US11917035B1 (en) * | 2022-12-15 | 2024-02-27 | Amazon Technologies, Inc. | Egress rate control in an event bus service |
CN116155842A (en) * | 2022-12-29 | 2023-05-23 | 天翼物联科技有限公司 | Method, system, equipment and medium for processing instruction message queue |
CN116389578B (en) * | 2023-06-06 | 2023-08-08 | 深圳市华曦达科技股份有限公司 | Method, system and readable storage medium for MQTT multitasking scheduling of network communication equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180063039A1 (en) * | 2016-08-23 | 2018-03-01 | Machine Zone, Inc. | Scalable, real-time messaging system |
US11113294B1 (en) * | 2019-07-16 | 2021-09-07 | Splunk Inc. | Recommending query templates during query formation |
Family Cites Families (42)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
SE0200418D0 (en) * | 2002-02-13 | 2002-02-13 | Ericsson Telefon Ab L M | A method and apparatus for computer load sharing and data distribution |
CN100458767C (en) * | 2002-03-28 | 2009-02-04 | 普里凯许公司 | Method and apparatus for reliable and efficient content-based routing and query and response in a publish-subscribe network |
US20050021836A1 (en) * | 2003-05-01 | 2005-01-27 | Reed Carl J. | System and method for message processing and routing |
US20070208837A1 (en) * | 2006-02-22 | 2007-09-06 | Lifen Tian | Device management system for processing client requests |
US9318108B2 (en) * | 2010-01-18 | 2016-04-19 | Apple Inc. | Intelligent automated assistant |
US8880524B2 (en) * | 2009-07-17 | 2014-11-04 | Apple Inc. | Scalable real time event stream processing |
US8291025B2 (en) * | 2009-10-23 | 2012-10-16 | International Business Machines Corporation | Controlling retention of publication |
US8825759B1 (en) | 2010-02-08 | 2014-09-02 | Google Inc. | Recommending posts to non-subscribing users |
GB2492258A (en) * | 2010-04-19 | 2012-12-26 | Ibm | Controlling message delivery in publish/subscribe messaging |
US8726284B2 (en) | 2010-06-10 | 2014-05-13 | Microsoft Corporation | Managing requests based on request groups |
US9250975B2 (en) * | 2011-01-26 | 2016-02-02 | International Business Machines Corporation | Elastic and scalable publish/subscribe service |
US9960928B1 (en) | 2011-07-07 | 2018-05-01 | Cisco Technology, Inc. | System and method for topic-based eventing for flexible system management |
US9591090B2 (en) * | 2011-08-22 | 2017-03-07 | Salesforce.Com, Inc. | Computer implemented methods and apparatus for sharing data of an information feed of an online social network |
US8738715B2 (en) | 2012-01-31 | 2014-05-27 | Global Relay Communications Inc. | System and method for processing messages in a messaging service |
US8903925B2 (en) * | 2012-05-14 | 2014-12-02 | Microsoft Corporation | Scheduled messages in a scalable messaging system |
US9646028B2 (en) | 2012-08-31 | 2017-05-09 | Facebook, Inc. | Graph query logic |
US10230815B2 (en) | 2013-12-11 | 2019-03-12 | Facebook, Inc. | Service-abstracting query interface |
CN104092767B (en) * | 2014-07-21 | 2017-06-13 | 北京邮电大学 | A kind of publish/subscribe system and its method of work for increasing message queue model |
US9948739B2 (en) * | 2014-08-04 | 2018-04-17 | Cbs Interactive Inc. | Techniques to aggregate and broadcast live event data in real-time |
EP3248340A4 (en) * | 2015-01-23 | 2018-01-03 | eBay Inc. | Processing high volume network data |
US20160219089A1 (en) | 2015-01-23 | 2016-07-28 | Ebay Inc. | Systems and methods for messaging and processing high volume data over networks |
WO2016115735A1 (en) | 2015-01-23 | 2016-07-28 | Murthy Sharad R | Processing high volume network data |
GB2560275B (en) | 2015-10-15 | 2021-09-01 | Push Tech Limited | Event driven subscription matching |
US11588776B1 (en) * | 2015-12-14 | 2023-02-21 | Amazon Technologies, Inc. | Publish-subscribe message updates |
US11863509B2 (en) * | 2015-12-18 | 2024-01-02 | Amazon Technologies, Inc. | Publish-subscribe message transformation |
CN108885627B (en) * | 2016-01-11 | 2022-04-05 | 甲骨文美国公司 | Query-as-a-service system providing query result data to remote client |
US10437635B2 (en) * | 2016-02-10 | 2019-10-08 | Salesforce.Com, Inc. | Throttling events in entity lifecycle management |
US10409650B2 (en) * | 2016-02-24 | 2019-09-10 | Salesforce.Com, Inc. | Efficient access scheduling for super scaled stream processing systems |
US10979371B2 (en) * | 2016-04-11 | 2021-04-13 | Facebook, Inc. | Techniques for messaging agent messaging interactions |
GB2550448A (en) * | 2016-05-17 | 2017-11-22 | Google Inc | Augmenting message exchange threads |
US20180330303A1 (en) | 2016-06-16 | 2018-11-15 | Globoforce Limited | Systems and Methods for Analyzing Recognition and Feedback Data for Talent and Culture Discovery |
US20180039621A1 (en) * | 2016-08-05 | 2018-02-08 | Monotype Imaging Inc. | Context analysis for message enhancement |
US10970140B2 (en) * | 2016-09-09 | 2021-04-06 | Huawei Technologies Co., Ltd. | Method, apparatus, and mobile terminal for associating notification messages |
US10270726B2 (en) * | 2017-02-24 | 2019-04-23 | Satori Worldwide, Llc | Selective distribution of messages in a scalable, real-time messaging system |
US20180302358A1 (en) | 2017-04-13 | 2018-10-18 | Facebook, Inc. | Methods and systems for presenting updates in a messaging thread |
US10744413B2 (en) * | 2017-09-07 | 2020-08-18 | DraftKings, Inc. | Systems and methods for dynamically generating event cards from message streams |
US11089133B1 (en) * | 2017-11-22 | 2021-08-10 | Amazon Technologies, Inc. | Synchronizing data with delayed subscriptions |
US10826984B2 (en) * | 2018-04-24 | 2020-11-03 | Futurewei Technologies, Inc. | Event stream processing |
US11165780B2 (en) | 2018-11-27 | 2021-11-02 | Dell Products L.P. | Systems and methods to secure publicly-hosted cloud applications to run only within the context of a trusted client application |
US20200311226A1 (en) | 2019-03-27 | 2020-10-01 | Mohammed Ali Othman | Methods, systems, apparatuses and devices for facilitating secure publishing of a digital content |
US20200402170A1 (en) | 2019-06-19 | 2020-12-24 | Chicago Mercantile Exchange Inc. | Deterministic Message Processing in a Distributed Network |
US11429669B2 (en) * | 2019-08-06 | 2022-08-30 | Twitter, Inc. | Managing query subscription renewals in a messaging platform |
-
2019
- 2019-10-30 US US16/668,811 patent/US11429669B2/en active Active
- 2019-10-30 US US16/669,044 patent/US11580165B2/en active Active
-
2020
- 2020-07-28 KR KR1020227007214A patent/KR102498752B1/en active Active
- 2020-07-28 BR BR112022001683A patent/BR112022001683A2/en not_active Application Discontinuation
- 2020-07-28 WO PCT/US2020/070315 patent/WO2021026553A1/en unknown
- 2020-07-28 CN CN202080055033.XA patent/CN114270344A/en active Pending
- 2020-07-28 JP JP2022507357A patent/JP2022538365A/en active Pending
- 2020-07-28 EP EP20757203.3A patent/EP3999961A1/en not_active Withdrawn
- 2020-07-28 KR KR1020227025846A patent/KR102498777B1/en active Active
- 2020-07-28 AU AU2020325362A patent/AU2020325362B2/en not_active Ceased
- 2020-07-28 CA CA3150018A patent/CA3150018A1/en active Pending
- 2020-07-28 CN CN202210911573.4A patent/CN115408604A/en active Pending
-
2022
- 2022-07-05 AU AU2022204800A patent/AU2022204800B2/en not_active Ceased
- 2022-07-20 JP JP2022115637A patent/JP2022159310A/en active Pending
- 2022-07-26 US US17/815,014 patent/US20220365979A1/en not_active Abandoned
- 2022-07-26 US US17/815,010 patent/US20220365978A1/en not_active Abandoned
- 2022-07-26 US US17/815,017 patent/US20220358167A1/en not_active Abandoned
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180063039A1 (en) * | 2016-08-23 | 2018-03-01 | Machine Zone, Inc. | Scalable, real-time messaging system |
US11113294B1 (en) * | 2019-07-16 | 2021-09-07 | Splunk Inc. | Recommending query templates during query formation |
Also Published As
Publication number | Publication date |
---|---|
WO2021026553A1 (en) | 2021-02-11 |
US20210042364A1 (en) | 2021-02-11 |
KR20220047796A (en) | 2022-04-19 |
US20220358167A1 (en) | 2022-11-10 |
CA3150018A1 (en) | 2021-02-11 |
AU2022204800A1 (en) | 2022-07-28 |
BR112022001683A2 (en) | 2022-06-07 |
JP2022538365A (en) | 2022-09-01 |
US11580165B2 (en) | 2023-02-14 |
EP3999961A1 (en) | 2022-05-25 |
US11429669B2 (en) | 2022-08-30 |
JP2022159310A (en) | 2022-10-17 |
AU2020325362B2 (en) | 2022-08-18 |
US20210044549A1 (en) | 2021-02-11 |
KR20220108213A (en) | 2022-08-02 |
CN114270344A (en) | 2022-04-01 |
AU2022204800B2 (en) | 2022-08-25 |
KR102498752B1 (en) | 2023-02-10 |
CN115408604A (en) | 2022-11-29 |
AU2020325362A1 (en) | 2022-03-31 |
KR102498777B1 (en) | 2023-02-09 |
US20220365979A1 (en) | 2022-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220365978A1 (en) | Managing query subscription renewals in a messaging platform | |
US8756325B2 (en) | Content management | |
US10270726B2 (en) | Selective distribution of messages in a scalable, real-time messaging system | |
US20200044881A1 (en) | Managing channels in an open data ecosystem | |
US20170111302A1 (en) | Systems and methods for transferring message data | |
US8874753B2 (en) | Optimized cooperation between resource list servers and presence servers | |
US10447623B2 (en) | Data storage systems and methods using a real-time messaging system | |
CN112543354B (en) | Service-aware distributed video cluster efficient telescoping method and system | |
US7984158B2 (en) | Web service for coordinating actions of clients | |
CN110798495B (en) | Method and server for end-to-end message push in cluster architecture mode | |
CN114978998B (en) | A flow control method, device, terminal and storage medium | |
US9043415B2 (en) | Managing a subscription hierarchy in presence systems | |
CN106330953A (en) | An intelligent router device, server device and data processing method thereof | |
US11863617B1 (en) | Dynamic decentralized hierarchical Holon network system | |
JP2011135305A (en) | Data restoring method, data restoration system, matching server, and device grouping program | |
CN118612223A (en) | Data processing method, device, system, computer equipment and storage medium | |
Wang et al. | PSVA: A Content-Based Publish/Subscribe Video Advertising Framework |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
STPP | Information on status: patent application and granting procedure in general |
Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION |
|
AS | Assignment |
Owner name: MORGAN STANLEY SENIOR FUNDING, INC., MARYLAND Free format text: SECURITY INTEREST;ASSIGNOR:TWITTER, INC.;REEL/FRAME:062079/0677 Effective date: 20221027 |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |