lx-webhook
v1.1.0
Published
lx-webhook ======
Downloads
3
Readme
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 Variable | Description | Default Value | |---|---|---| | DEBUG | Specifies which SLF logs should be activated. | | | TENANTS | Tenants that the service is active for. Value is comma separated, for example pof,stenaline,kn | | | RABBIT_HOSTNAME | Default RabbitMQ hostname | localhost | | RABBIT_PORT | Default RabbitMQ port | 5672 | | RABBIT_USERNAME | RabbitMQ Username | guest | | RABBIT_PASSWORD | RabbitMQ Password | guest | | RABBIT_CONCURRENT_MESSAGES | The max number of concurrent messages allowed. | 8 | | MONGO_HOSTNAME | Default MongoDB adress | localhost | | MONGO_PORT | Default MongoDB port | 27017 | | NODE_TELEGRAF_URI | URI to Telegraf | udp://:8094 | | NODE_TELEGRAF_BUFFER_SIZE | Max 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 | |---| | <tenant>_RABBIT_HOSTNAME | | <tenant>_RABBIT_PORT | | <tenant>_RABBIT_USERNAME | | <tenant>_RABBIT_PASSWORD | | <tenant>_MONGO_HOSTNAME | | <tenant>_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.