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 · 0 comments
Open

STOMP redelivery policy on SUBSCRIBE doesn't work #635

akaNightmare opened this issue Aug 2, 2024 · 0 comments

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();
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

1 participant