0.0.6 • Published 4 years ago

azure-storage-queue-consumer v0.0.6

Weekly downloads
20
License
-
Repository
github
Last release
4 years ago

Azure Storage Queue Consumer

Azure Storage Queue Consumer is a package that works with Azure Storage Queue.

It allows users to use Azure Storage Queue and create a consumer that looks for new messages in the queue.


Getting Started

Prerequisites: before you can start using this package you must have an Azure Subscription and a Storage Account

Install the package

The recommended way to install Azure Storage Queue Consumer is with npm. To do so type the following in a terminal:

npm install azure-storage-queue-consumer

Examples

Import the package

To use the QueueConsumer we first need to import it, this can be done on the following way:

import QueueConsumer = require("azure-storage-queue-consumer");

After importing the package we need to setup the consumer so we can consume the messages from our queue.

const consumer = QueueConsumer.create({
  account: "storageAccountName",
  sas: "Shared Access Signatures",
  queueName: "queueName",
  handleMessage: async (message) => {
    //Do something with the message
  },
  interval: 3000, //Interval in number
});

Now that we created the Consumer we need to start the consumer to start consuming the messages.

consumer.start();

If you don't want to consume messages anymore you can stop the consumer.

consumer.stop();

What still needs to be done:

  • Deleting messages after consuming and processing it
  • More to come
0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago