1.0.19 • Published 1 year ago

dls-messagelibrary v1.0.19

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

MessageLibrary

Installation

npm i dls-messagelibrary

Usage

Publish Function

import { pushMessageToServiceBus, [YOUR_MESSAGE_MODEL_YOU_NEED] } from "dls-messagelibrary"

...
const messageBody:[YOUR_MESSAGE_MODEL_YOU_NEED] = {
    // message body
}
await pushMessageToServiceBus([CONNECTION_STRING],[QUEUE_NAME], messageBody)
...

CONNECTION_STRING - You can find the connection string in google drive. Please use it in .env
QUEUE_NAME - Name of the queue you want to push a message to

NOTE: Each queue will have its dedicated message TS model. The naming convention will me that you take the queue name and make the first letter capital and add Message to the end. So if you for exmaple decide to push message to logging queue, you should use LoggingMessage as model for the message.

Logging Service

You can also take advantage of the logging service

import { LoggingService } from "dls-messagelibrary";

const loggingService = new LoggingService("EmailerService", [SERVICEBUS_STRING])
...
await loggingService.logInfo(`This is your message`, [LOG_BODY]);
...

LOG_BODY - JS object that should be stored in log

NOTE: you can also you other methods available on loggingService

Docs links

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-nodejs-how-to-use-queues?tabs=connection-string

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago