Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Javascript/nodejs Azure Service Bus Complete a message

I have an application in nodejs using library @azure/service-bus. I am receiving messages using following code:

const { ServiceBusClient } = require("@azure/service-bus");

const sbClient = new ServiceBusClient(connectionString);

// createReceiver() can also be used to create a receiver for a subscription.
const receiver = sbClient.createReceiver(queueName);
const myMessages =   await receiver.receiveMessages(1);

BUT after receiving the message , it is still there in service bus. Accordig to this documentation https://docs.microsoft.com/en-us/javascript/api/overview/azure/service-bus-readme?view=azure-node-latest, I need to use completeMessage function to get it out of service bus, but how can i do it?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Please try calling completeMessage using something like:

await receiver.completeMessage(myMessages[0]);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading