Is there a chance of overlooking messages when utilizing long polling with nginx and the pushstream module?

After extensive research through documentation, forums, and examples, I have not been able to locate a clear description of how the pushstream module functions in the following scenario:

I am utilizing nginx+pushstream to provide status updates for users waiting on server-side actions. The long polling technique is used where the client reconnects after each message delivery or connection timeout.

In cases where multiple messages are sent to the subscribed queue simultaneously, is there a possibility that the client might miss a message while in the process of reconnecting? Does the pushstream module handle this situation?

Appreciate any insights provided on this matter! :-)

Answer №1

After an unexpected search on a different topic, I stumbled upon a discussion in Google Groups that provided the perfect answer to my question.

The developer of the pushstream module shared the following insight:

To achieve your goal, you can set the If-Modified-Since header when connecting, using the current time as the reference for new user connections. This way, the user will only receive messages sent after this specific time.

I have concerns about potential message loss when using long polling without storing messages or with a limited setting for push_stream_max_messages_stored_per_channel.

Source: https://groups.google.com/forum/#!topic/nginxpushstream/4VutBQwx3zM

Therefore, ensuring that messages are stored (with push_stream_store_messages enabled) eliminates the risk of losing messages. The HTTP-Headers If-None-Match and If-Modified-Since play a crucial role in guaranteeing this.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using SystemJS to Import External JavaScript Library into Angular 2

Issue with mapping fileSaver, while angular2-jwt is functioning properly. Performed npm install file-saver -save to obtain file-saver and then referenced it accordingly (confirmed file presence in libs directory via gulp task) In index.html, script inclu ...

Utilizing React to connect with Metamask and share the signer across various contracts

I'm currently working on a solution for sharing signers across multiple JavaScript files. In my walletConnect.js file, I successfully connect to Metamask and retrieve an ERC20 token contract. async function connect(){ try{ const accounts = awai ...

Execute function when button is not active

Within my Angular 2 application, I have a form along with the following code snippet that relates to the button responsible for submitting the form. <button (mouseover)="showMesageValidation()" class="edm-button" type="submit" [disabled]="!f.valid"> ...

transmit JSON formatted form data to an AngularJS platform

I have a webpage built on AngularJS with a login feature. I want to iframe this webpage onto my own page and automatically log in my users. Upon inspecting the AngularJS site, I noticed that the login procedure expects a json object. I have tried multipl ...

Information is not transferring to Bootstrap modal

I attempted to send a value to a modal by following the instructions on the Bootstrap documentation here. However, I am facing an issue where the data is not being successfully passed. To trigger the modal, use the following button: <button type=" ...

Transform the JSON data into a uniform structure by eliminating unnecessary information

Here is a snippet of JSON Data from Mongo : { "status": 1, "message": "", "data": [ { "_id": "5f489968a26b303c54d0a174", "name": "Mobile", "SubCategory": [ { "_id": ...

Generating an MD5 hash for a UTF16LE string in Javascript (with no BOM and excluding 0-byte at the end) - Illustrated with a C#

I've been trying to figure out how to get an MD5 Hash of a UTF16-LE encoded string in JavaScript for the past few days. I have a method in C# as an example, but I'm not sure how to replicate it in JavaScript. Example: public string GetMD5Hash ( ...

When initiating the Grunt Express Server, it prompts an issue: Error: ENOENT - the file or directory 'static/test.json' cannot be found

I'm currently in the process of updating my app to utilize the Express Node.js library. As part of this update, I have made changes to my Grunt.js tasks to incorporate the grunt-express-server package. However, after running the server successfully, I ...

Develop a unique splitter code that utilizes pure javascript and css, allowing users to drag and drop with precision

I am facing an issue with setting the cursor above my drop panel, as it results in a flicker effect. How can I set the cursor for my example to work properly? I have tried multiple different approaches to make this work. Although I am using the provided ...

Use JavaScript to overlay a rectangle on top of an HTML element

Although I found a similar question here, it lacks any code in both the question and the answer. My goal is to convert this functionality into a 100% JavaScript solution. Currently, I can draw a rectangle on top of HTML content using PHP. I scrape a webs ...

Reactjs: Tips for precisely cropping an image to a specific aspect ratio using client-side techniques

Looking to crop an image with a minimalist approach to achieve a specific aspect ratio. For instance, if we have an image sized at 3038 x 2014 px, and desire a 1:2 aspect ratio, we would crop it to 3021 x 2014 px. The crop would be made from the center of ...

Issue with receiving output from tessearct.js in PDF format

I am currently working on a basic javaScript OCR (Optical Character Recognition) application using tesseract.js. I have included {tess_create_pdf: "1"} in the .recognize() method to receive the result in PDF format, but it seems to be malfunctioning. Can ...

Using Multiline Strings for Arguments

Is there a way to successfully pass multi-line strings containing spaces and tabs as a parameter to an express server? Below is the Express.js code snippet which accepts the parameter: app.get('/:prompt', async (req, res) => { ...

Guide on incorporating jQuery library files into existing application code with the npm command

Recently, I used a node JS yo ko command to create a single-page application using Knockout-JS. Following that, I proceeded to install jquery packages using the command npm install jquery The installation was successful. However, my current goal is to in ...

Webpack is struggling to locate core-js paths when running on Windows operating systems

When running webpack, I am encountering the following errors: ERROR in ./node_modules/core-js/index.js Module not found: Error: Can't resolve './es' in 'pathtoproject\node_modules\core-js' @ ./node_modules/core-js/index. ...

What is causing jQuery toggleClass to fail in removing a class?

I have successfully implemented a Skills accordion feature, but I am now trying to add a button that toggles all the skill sections at once. However, I am facing issues with jQuery not correctly adding or removing classes on the .accordion-trigger-all elem ...

Changing a property of an object in Angular using a dynamic variable

It seems like I may be overlooking a crucial aspect of Angular rendering and assignment. I was under the impression that when a variable is updated within a controller's scope, any related areas would automatically be re-evaluated. However, this doesn ...

The fading effects are not functioning as expected in the following code

Hey there, I'm not the most tech-savvy person, but I managed to come up with this code for page redirection. Unfortunately, I couldn't quite get the fade out and fade in effects to work properly when executing it. If anyone out there can help me ...

Having trouble locating the issue in my React application

As part of a tutorial project, I am developing an e-Commerce application using React. Currently, I am encountering an error message stating 'TypeError: Cannot read property 'length' of undefined' when dealing with a cart object. Let me ...

Is it unwise to rely on Sequelize for validating objects that are not stored in a database?

Currently, I am utilizing Sequelize as my ORM and find the powerful built-in model validation to be quite impressive. I am contemplating leveraging Sequelize as a schema validator in specific scenarios where there would not be any actual database writes. E ...