Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redelivery of messages after acknowledging them #643

Open
mlsomers opened this issue Jan 14, 2025 · 1 comment
Open

Redelivery of messages after acknowledging them #643

mlsomers opened this issue Jan 14, 2025 · 1 comment

Comments

@mlsomers
Copy link

Disclaimer: I have no idea if this is an issue with stomp-js/stompjs, RabbitMQ or the Stomp plugin in RabbitMQ.

My web application uses Stomp to show toast messages. These get acknowledged as soon as the user clicks an 'x'. Otherwise they keep popping up with each page load. This is ok so far.

Now I have added a special Stomp message that will invoke a download (when the server is ready after generating a file it notifies the client). The code looks like this:

    if (msg.msgType === 'download')
    {
        window.open('/Download?id=' + msg.DocId, '_blank');
        message.ack();
        return;
    }

This in itself works fine, however any toast messages closed after the download no longer register the ack. They do call ack(); and there are no errors logged in the console, but with the next page refresh they pop up again. In RabbitMQ management I see the messages going from Unacked back to Ready when the download starts.

While looking for similar cases I came across #579 and I guess that the download may be doing something similar as opening a new tab. In fact in Firefox it does exactly that. In Chrome it does not open a tab, but the symptoms still remain (all ack()'s after that are ignored).

An ugly workaround is to reload the page directly after invoking the download...

Could someone confirm or deny the issue being related to #579 ? Is there a recommended fork?

@kum-deepak
Copy link
Member

At this stage, I can only provide information to diagnose the issue.

Please enable the debug log and check the console output. It gets pretty verbose and should show what packets are sent and received.

If you need any more help, please attach the entire debug log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants