It is apparently not possible using STOMP so I've changed the code to use the library ampq10 instead.
import amqp10 from 'amqp10';
const AMQPClient = amqp10.Client;
const amqpClient = new AMQPClient({
receiverLink: {
attach: {
rcvSettleMode: amqp10.Constants.receiverSettleMode.settleOnDisposition
},
creditQuantum: 1
}
});
This will allow you to do a receiver.accept(message); if successfully handling the message. If you just .disconnect() whitout an .accept() the message will not be removed from the queue.