fusion-helper-queue-manager v1.0.14
Fusion Helper Queue Manager
This is a library that the fusion helper application uses to connect to its azure storage queue. It also pushes messages to the specified queue and dequeues messages so the azure functions can process the messages one at a time.
Installation
Using npm:
npm i --save fusion-helper-queue-manager
Usage
The package contains two objects
- FusionHelperQueueService
FusionHelperQueueMessage
- fileName - the name of the file stored in the database that contains the request.
FusionHelperQueueService
This is the main service used to communicate with the fusion helper storage queue.
Creating an Instance
import { Fusion } from "fusion-helper-queue-manager";
const queueSvc = new FusionHelperQueueService(storageConnectionString, queueName)
- StorageConnectionString - This is the connection string to the storage account containing your queue
- queueName - This is the queue name of the queue used to transfer messages between applications/services.
Using The Instance - Write a Message
const message = await queueSvc.queue(fileName);
Using The Instance - Receive Messages
const receivedMessage = await queueSvc.deque(messageCount, deleteMessages);
messageCount (number) - defaults to 1 if no value is passed. Tells the service how many messages to pull from the queue.
deleteMessages (boolean) - tells the service to delete the messages or keep them on the stack.
FusionHelperQueueMessage
his is what you would expect to get back from a call to get a message. It is a JSON serialized object.
fileName This is the only property in the object. It contains the file name associated to the rows we need to process.
const fileName = message.fileName;