1.1.0 • Published 10 months ago

lx-webhook v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

lx-webhook

Purpose

This service is responsible for listening to events that happens in Lynx and sending them to InBroker or Tapi based on webhook definitions defined in MongoDb.

Usage

Only the TENANTS env variable is needed to run locally.

Environment VariableDescriptionDefault Value
DEBUGSpecifies which SLF logs should be activated.
TENANTSTenants that the service is active for. Value is comma separated, for example pof,stenaline,kn
RABBIT_HOSTNAMEDefault RabbitMQ hostnamelocalhost
RABBIT_PORTDefault RabbitMQ port5672
RABBIT_USERNAMERabbitMQ Usernameguest
RABBIT_PASSWORDRabbitMQ Passwordguest
RABBIT_CONCURRENT_MESSAGESThe max number of concurrent messages allowed.8
MONGO_HOSTNAMEDefault MongoDB adresslocalhost
MONGO_PORTDefault MongoDB port27017
NODE_TELEGRAF_URIURI to Telegrafudp://:8094
NODE_TELEGRAF_BUFFER_SIZEMax buffert size for Telegraf. How many measuring points to send at once.10

The following environment variables overwrites the default shared variable for a specific tenant. For example POF_RABBIT_HOSTNAME overwrites the RABBIT_HOSTNAME for the tenant POF.

Environment Variable
\_RABBIT_HOSTNAME
\_RABBIT_PORT
\_RABBIT_USERNAME
\_RABBIT_PASSWORD
\_MONGO_HOSTNAME
\_MONGO_PORT

Components

This service does not contain much logic. It connects parts that are already implemented. The idea is to listen to commits on LX3.WEBHOOKS.INTERNAL.<tenant> and handing them of to WebhookService to deal with filtering and publishing of events.

index.ts

This is were most of the work is done and everything is connected.

WebhookService

This module deals with filtering and prepearing webhooks, this is a dependency located in the Lynx3 repository.