#StackBounty: #node.js #websocket #activemq #stomp stomp.ack is yielding Error: Unexpected ACK received for message-id

Bounty: 50

I have tried possible combinations and searched over the internet but couldn’t make this work, error is:

Error: Unexpected ACK received for message-id

It will be really helpful if anyone can point out if there is some conceptual mistake in following code:

var Stomp = require('stomp-client');
var client = new Stomp(host, port, user, pass);
client.connect(function(sessionId) {
    var subId = client.subscribe(/topic/foo, function(body, headers) {
        client.ack(headers['message-id'], subId);
        var message = ['abc', 'def'];
        client.publish(`/topic/bar`, `some_message`);
    }, {ack: 'client'});
    client.on('error', function(er) {
        console.error(er);
    });
});


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.