Mobile devices receive data asynchronously from a variety of sources. The data is pushed to the mobile devices and includes updates to online user profiles (e.g., at social networking web sites), weather and traffic conditions, and notifications such as package delivery notifications. Existing systems include a plurality of services sending the data through a plurality of gateways to the mobile devices. However, existing systems fail to provide a mechanism in the push environment for detecting failures along the communication path to the mobile devices.
Embodiments of the invention provide end-to-end validation along a communication path involving a service, a gateway, and a computing device. A component executing on the computing device receives a request from an application to register an application endpoint. The component registers the application endpoint with the gateway responsive to the received request. The application subscribes to the service. The gateway defines an inactivity timeout value for the application endpoint, and monitors the communication path. When the component receives a notification from the gateway of expiration of the inactivity timeout value, the component notifies the application to re-register with the gateway and to re-subscribe with the service.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
Corresponding reference characters indicate corresponding parts throughout the drawings.
Referring to the figures, embodiments of the disclosure enable end-to-end validation in a push environment. In an exemplary push environment such as illustrated in
The service 102 is any type of service that pushes content to the computing device 104. For example, the service 102 may include an email server, a sales server, a web server, a database server, a file server, a print server, or any other kind of server.
The messages include any kind of information or data such as text messages, electronic mail messages, voice messages, images, and video. The computing device 104 can be a mobile telephone, a portable media player, a smartphone, a personal digital assistant, an information appliance, a personal communicator, a handheld game console, an ultra-mobile personal computer, a handheld television, or any other type of electronic device that is able to communicate with another system through a network.
In some embodiment, there are a plurality of services 102, a plurality of gateways 106, and a plurality of computing devices 104. The computing device 104 has at least one application 108 executing thereon. The application 108 has one or more application endpoints 110 for receipt of the messages. The application endpoints 110 are associated with, for example, a mail application program, an instant messaging application program, or a web browser. The computing device 104 has at least one push component or pipe component for interfacing between the gateway 106 and the application 108. In some embodiments, there is one push client 112 for each application 108. In other embodiments, there is one push client 112 for all the applications 108 executing on the computing device 104.
In the example of
Referring next to
In some embodiments, registration includes receiving, by the push client 112, a request from the application 108 to register the application endpoint 110 (e.g., RegisterEndpoint). The push client 112 identifies one or more channels available for communication and selects one of the identified channels. The push client 112 works with the gateway 106 to define an object, address space, or other globally unique identifier such as an endpoint uniform resource identifier (URI) for the selected channel, and provides the defined object to the application 108. In some examples, the channel is selected based on one or more policy settings for the application 108. Alternatively, the gateway 106 provides the object to the push client 112 to give to the application 108.
The push client 112 registers the application endpoint 110 with the gateway 106, and provides the object to the application 108. The application 108 uses the object to subscribe with the service 102. Additionally, the application 108 or the push client 112 defines a registration timeout value. The registration timeout value includes, for example, a maximum time in seconds for a message to be received by the application 108 after requesting registration from the push client 112. The push client 112, or the application 108, calculates an elapsed time since, for example, the registration request was submitted to the push client 112. If the elapsed time exceeds or violates the registration timeout value before a first message is received by the application 108, the application 108 is notified of a registration failure or timeout condition. Responsive to the notification, the application 108 de-registers and unsubscribes, then subsequently re-registers and subscribes. For example, the application 108 may re-register with another gateway 106.
Responsive to the registration, the application 108 receives the object such as a uniform resource locator (URL) or other address space from the gateway 106. The object identifies the gateway 106 and the computing device 104. The computing device 104 subscribes to receive messages from the service 102. This subscription occurs separate from, or independent, exclusive, or outside of the gateway 106. In other words, the subscription occurs directly between the application 108 and the service 102 without involvement of the gateway 106. During subscription, the application 108 communicates the object to the service 102 and requests that the messages be sent to the application 108 via the object.
The object may be any type of identifier that can identify the gateway 106. In one example, the URL has the following exemplary format: {Gateway Domain Name Server Name}/{Computing Device Name}/{Application Name}/{Extension}. The first portion “Gateway Domain Name Server Name” is the domain name of the gateway 106 in the Domain Name System (DNS). The first portion tells the service 102 where to send the message (e.g. to the gateway 106). The second portion “Client Name” tells the gateway 106 which computing device 104 to receive the message. The third portion “Application Name” tells the computing device 104 which application 108 executing on the computing device 104 to receive it. The fourth portion “Extension” is an extension of the application 108. The “Extension” is optional. One particular example of the object includes PushGW.xyz.com/Client 123/App456/doc.
After or during registration, the application 108 or gateway 106 defines an inactivity timeout value for the application endpoint 110. The inactivity timeout value represents a maximum time in seconds between receipt of messages from the service 102. In an example, the application 108 provides the inactivity timeout value to the gateway 106. The gateway 106 monitors the communication path. If there is no activity by the gateway 106 for that application endpoint 110 after the inactivity timeout value expires, the gateway 106 notifies the push client 112 or the application 108 of the timeout condition. In some embodiments, to avoid the timeout expiring absent of communication failure, the service 102 sends periodic “heartbeat” messages to the gateway 106. Such messages are not delivered to the application endpoint 110 (e.g., to save device resources) and serve to confirm liveliness of the application endpoint 110. In such embodiments, the service 102 knows the inactivity timeout value so that the service 102 can time the heartbeat messages to be more frequent than the timeout. The service 102 may learn the inactivity timeout value as part of subscription.
Exemplary application programming interfaces for implementing registration and other functions are described in Appendix A.
Referring next to
Referring next to
Referring next to
In some embodiments, the channel timeout value detects whether the device 104 is interested in the registered application endpoint 110. If the device 104 gets disconnected (e.g., due to a general packet radio service disruption), the channel/endpoint is still maintained on the gateway 106, provided the push client 112 re-establishes the connection within the channel timeout interval. However, if the push client 112 unregisters the application endpoint 110 and the request is not delivered or processed by the gateway 106, this mechanism allows the gateway 106 to clean up the state (e.g., remove the channel and associated queue) after the channel timeout value interval and conserve memory.
If the channel timeout value is longer than the inactivity timeout value, the device 104 may be offline for a longer period of time (e.g., up to the channel timeout value) and the gateway 106 queues messages to the device 104 in the buffer. However, the application 108 does not learn about the potential failure of communication for a longer period of time.
If the channel timeout value is set to the same value as the inactivity timeout value, the push client 112 provides a guarantee to the application 108 that if any communication failure (e.g., be it on the channel between the device 104 and the gateway 106 or between the gateway 106 and the service 102) lasts more than the channel timeout value, the application 108 is notified and can initiate a recover sequence.
Referring next to
Referring next to
Referring next to
Aspects of the invention transform a general-purpose computer into a special-purpose computing device when configured to execute the instructions described herein.
While aspects of the invention are described with reference to the computing device 104 being a mobile computing device such as a mobile telephone, embodiments of the invention are operable with any computing device. For example, aspects of the invention are operable with devices such as laptop computers, gaming consoles, hand-held or vehicle-mounted navigation devices, portable music players, and other devices.
By way of example and not limitation, computer readable media comprise computer storage media and communication media. Computer storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embody computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and include any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
Although described in connection with an exemplary computing system environment, embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with aspects of the invention include, but are not limited to, mobile computing devices, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, gaming consoles, microprocessor-based systems, set top boxes, programmable consumer electronics, mobile telephones, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
Embodiments of the invention may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. The computer-executable instructions may be organized into one or more computer-executable components or modules. Generally, program modules include, but are not limited to, routines, programs, objects, components, and data structures that perform particular tasks or implement particular abstract data types. Aspects of the invention may be implemented with any number and organization of such components or modules. For example, aspects of the invention are not limited to the specific computer-executable instructions or the specific components or modules illustrated in the figures and described herein. Other embodiments of the invention may include different computer-executable instructions or components having more or less functionality than illustrated and described herein.
The embodiments illustrated and described herein as well as embodiments not specifically described herein but within the scope of aspects of the invention constitute exemplary means for identifying a communication failure based on the inactivity timeout value, and exemplary means for re-establishing the communication path responsive to expiration of the inactivity timeout value.
The order of execution or performance of the operations in embodiments of the invention illustrated and described herein is not essential, unless otherwise specified. That is, the operations may be performed in any order, unless otherwise specified, and embodiments of the invention may include additional or fewer operations than those disclosed herein. For example, it is contemplated that executing or performing a particular operation before, contemporaneously with, or after another operation is within the scope of aspects of the invention.
When introducing elements of aspects of the invention or the embodiments thereof, the articles “a,” “an,” “the,” and “said” are intended to mean that there are one or more of the elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that there may be additional elements other than the listed elements.
Having described aspects of the invention in detail, it will be apparent that modifications and variations are possible without departing from the scope of aspects of the invention as defined in the appended claims. As various changes could be made in the above constructions, products, and methods without departing from the scope of aspects of the invention, it is intended that all matter contained in the above description and shown in the accompanying drawings shall be interpreted as illustrative and not in a limiting sense.
Exemplary application programming interfaces (API) are described below.
Creates object representing endpoint. Until the endpoint is registered, no communication with gateway is established and no state on the gateway is created.
[out] hEndpoint
Sets endpoint settings. The API may be called at any endpoint state, however since most options apply only to active endpoints, setting may not take effect until endpoint is registered. All options have reasonable defaults that may differ for different channels/gateways.
[in] hEndpoint
[in] Option Type
[in] blobOption—a structure containing option parameters as specified in the table below.
RegisterEndpoint [async]
Establishes communication channel between the device and the gateway, allocates endpoint state on the gateway and returns endpoint URL to the appliation. The URL is generated by the channel/gateway.
Registered endpoint does not guarantee end-to-end from service to device. If service is not able to reach the device using the endpoint, application may unregister and register the endpoint. The Push Client will first try to use a different gateway and then different channel if the previous one was unreachable.
The API is asynchronous and the call returns immediately as pending. The Push Client performs registration in the background and notifies application when the process completes. The application can then obtain the endpoint URL. Application may cancel pending registrations at any time by calling UnregisterEndpoint or CloseEndpoint.
The call fails with ALREADY_REGISTERED error if the endpoint is already registered or RegisterEndpoint or RegisterStaticEndpoint call is pending.
[in] hEndpoint
[in, optional] strApplicationServer—name of Application Server that is authorized to send messages to the endpoint. Application Server will need to authenticate using SSL mutual authentication in order to send a message to the endpoint.
If not specified, endpoint will not require Application Server to authenticate. If endpoints w/o authentication are not supported, the registration will fail
[in, optional] nEndToEnd Verification Timeout—maximum time in seconds for the first message to arrive to the endpoint. If initial message does not arrive within specified time the endpoint is considered invalid and application is notified. 0 means no timeout. If not specified, default is 120 seconds.
[in] nInactivity Timeout—maximum time in seconds between massages. If endpoint is inactive for longer than the specified time the endpoint is considered invalid and application is notified. 0 means no timeout. If not specified, default is 0.
[out] strEndpointURL—URL representing registered endpoints. If strApplicationServer was not specified then the endpoint does not require authentication and the URL itself includes the authorization ticket and MUST NOT be transmitted in the clear.
RegisterStaticEndpoint [async]
Establishes communication channel between the device and the gateway and registers device with a static endpoint. Unlike RegisterEndpoint, this API does not return endpoint URL. Static endpoints URLs are predictable (or discoverable through the gateway) and thus do not need to be communicated by the application to the Application Server.
Static endpoints do not support initialization and inactivity timeouts. Lifetime of static endpoint is fully controlled by the channel/gateway. Application will be notified when endpoint is deleted by the gateway.
The API is asynchronous and the call returns immediately as pending. The Push Client performs registration in the background and notifies application when the process completes. Application may cancel pending registrations at any time by calling UnregisterEndpoint or CloseEndpoint.
The call fails with ALREADY_REGISTERED error if the endpoint is already registered or RegisterEndpoint or RegisterStaticEndpoint call is pending.
[in] hEndpoint
[in] strChannel—identifies channel used to register the static endpoint. Static endpoints can be only registered on a specific channel and are discoverable through the gateway on which they are registered.
[in] strApplication—unique identifier of application. If a static endpoint with this identifier is already registered on the device, the call will fail.
Deregisters the endpoint on the gateway and dereferences the channel connection. The API is synchronous and call completes immediately although the actual deregistration with the gateway will be completed asynchronously (e.g. in particular when device does not have connectivity with the gateway, deregistration will be pending until connection is reestablished). Application is not notified about completion of deregistration. Pending deregistration is not associated with the local endpoint object (hEndpoint) and the endpoint can be reregistered immediately after the API returns. The Push Client service must be able to handle several pending deregistration requests however it may drop deregistration requests that cannot be completed after some time since the gateway will independently cleanup endpoint state for an unreachable device anyways.
[in] hEndpoint
Performs DeregisterEndpoint, if necessary, and destroys the local endpoint object.
[in] hEndpoint
GetEndpointNotification [async]
Returns notification associated with the endpoint when available. There are two types of notifications:
1. MESSAGE—push message(s) are queued and available for retrieval using GetEndpointMessage.
2. STATUS—endpoint status has changed since the last time application checked it using GetEndpointStatus.
The API is asynchronous. The call returns immediately as pending and application is notified of completion when a notification is available. After processing the notification application calls GetEndpointNotification again. Only one outstanding call to GetEndpointNotification is allowed; the API will fail if there is already a pending call.
[in] hEndpoint
[in] dwNotificationsRequested—bitmap indicating which notification types (MESSAGE and/or STATUS) the application is interested in.
[out] dwNotificationsAvailable—bitmap indicating which notifications are available.
Retrieves message from local endpoint queue. If there are no messages in the queue, the API returns appropriate error code.
[in] hEndpoint
[out] blobMessage
Returns status of the endpoint. Status changes are not queued and only current status is returned.
[in] hEndpoint
[out] Status—structure describing endpoint status: