Browse Prior Art Database

Method for handling event gaps in WebSockets-based server push Disclosure Number: IPCOM000239267D
Publication Date: 2014-Oct-24
Document File: 3 page(s) / 92K

Publishing Venue

The Prior Art Database


Disclosed is a method to eliminate message gap in a modern distributed system that uses message brokers to maintain services.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 01 of 3

Method for handling event gaps in WebSockets-based server push

Modern distributed systems often use message brokers to ensure all the services that comprise the system are up to date . Services use a request/response pattern to obtain each other's state, but this soon becomes unmanageable as the number of services in the system grows. When such a system serves Web pages to the users , there is a desire to keep the pages up to date

without the need to refresh the pages (again, request/response pattern). Server push technologies such as Web Sockets*are used to implement this, and server-client communication is normally performed using push-aware service and a JavaScript* (JS) client running inside the browser. The term server push is used to mean any mechanism whereby the server can initiate the sending of information to the client, and includes WebSockets, Extensible Markup Language Hypertext Transfer Protocol Request (XHR) polling, long polling, etc.

Consider the following system consisting of a JavaScript client (browser), Node.js service, Message Broker and a Java* service (Node.js and Java are used to indicate that the problem is not technology-specific). The sequence that describes the problem is as follows:

1. User navigates to the Web page containing JavaScript code that uses a server push mechanism . Browser performs an HTTP GET to the server.

2. Service responds by serving Hypertext Markup Language (HTML) and JavaScript to the client

3. Meanwhile, another service publishes a number of messages (msg1, msg2)

4. Message Broker delivers the messages to the original service

5. The JavaScript in the browser is being parsed and activated. It initiates a server push connection with the server.

6. Service 2 publishes another message (msg3)

7. Since the server push connection is now active, the first service emits this message to the JavaScript client running in the


Figure 1: Problematic sequence, creates message gap


Page 02 of 3

The problem is a gap in message delivery. Due to the delay between initial page response and...