Posts

Showing posts from October, 2017

Retrieve records from Azure Service Bus queue but not deleting data

Image
I followed below sample from " https://github.com/noodlefrenzy/node-amqp10 " to retrieve records from Azure Service Bus queue.  However, all data were deleted after run the code.  const AMQPClient = require('amqp10').Client; const Policy = require('amqp10').Policy; const protocol = 'amqps'; const keyName = 'RootManageSharedAccessKey'; const sasKey = 'your_key_goes_here'; const serviceBusHost = 'namespace.servicebus.windows.net'; const uri = `${protocol}://${encodeURIComponent(keyName)}:${encodeURIComponent(sasKey)}@${serviceBusHost}`; const queueName = 'partitionedQueueName'; const client = new AMQPClient(Policy.ServiceBusQueue); client.connect(uri) .then(() => Promise.all([client.createReceiver(queueName)])) .spread((receiver) => {     console.log('--------------------------------------------------------------------------');     receiver.on('errorReceived', (err) => {         // check for er...