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

STOMP redelivery policy on SUBSCRIBE doesn't work #635

Open
akaNightmare opened this issue Aug 2, 2024 · 1 comment
Open

STOMP redelivery policy on SUBSCRIBE doesn't work #635

akaNightmare opened this issue Aug 2, 2024 · 1 comment

Comments

@akaNightmare
Copy link

Hello, trying to implement redelivery policy on SUBSCRIBE and have no luck.

Is there any way to reach that?

Example:

const { WebSocket } = require('ws');

const { Client } = require('@stomp/stompjs');

Object.assign(global, { WebSocket });

const client = new Client({
    brokerURL: 'ws://0.0.0.0:61624',
    reconnectDelay: 5000,
    heartbeatIncoming: 4000,
    heartbeatOutgoing: 4000,
    onConnect: () => {
        client.publish({
            destination: '/queue/Test.Queue',
            body: JSON.stringify({ field1: 'value1', field2: 'value2' }),
            headers: { 'correlation-id': '6666fe222570b857770849fe', persistent: 'true' },
            skipContentLengthHeader: true,
        });

        client.subscribe(
            '/queue/Test.Queue',
            message => {
                console.log('tick');
                message.nack();
            },
            {
                ack: 'client-individual',
                'activemq.maximumRedeliveries': '5',
                'activemq.redeliveryDelay': '1000',
                'activemq.useExponentialBackOff': 'true',
                'activemq.backOffMultiplier': '2',
                'activemq.initialRedeliveryDelay': '500',
                'activemq.maximumRedeliveryDelay': '60000',
            },
        );
    },
});

client.activate();
@OlivierVerhaegen
Copy link

Hi,

I'm looking for the same solution as you. I would like automatic redelivery of messages if they aren't acknowledged.

Reading the following post it seems that the only way to achieve this using ActiveMQ + STOMP is by reconnecting.

https://stackoverflow.com/questions/63825040/how-to-redeliver-a-stomp-message-to-the-consumer-in-case-of-any-processing-failu

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