balintsoos / webhook-service

:anchor: Notify integration partners about events

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚓ webhook-service

Notify integration partners about events

Tech Stack

  • Node.js + Typescript
  • MongoDB
  • RabbitMq
  • Docker

How to use

Start everything up:

$ make up

Subscribe to an event:

Send a POST request to http://localhost:8080/subscriptions with a payload like this:

{
  "event": "order",
  "partner": 1,
  "address": "http://web:8080/test"
}

Send an event:

You can open up the RabbitMQ Management Console (username and password is guest) and publish messages into the events queue, for example:

{
  "type": "order",
  "partner": 1,
  "data": { "foo": "bar" }
}

Still has much room for improvement, for example

  • E2E testing, especially the business logic inside the workers

  • unit testing of modules

  • handle constantly failing webhooks with exponential backoff and/or retry limit and eventually disable them (a good read)

  • validate payload on /subscriptions endpoint

  • authentication & authorization

  • start workers after rabbitmq is properly up (use wait-for-it.sh instead the current restart: on-failure)

lots of ideas came from these sources:

About

:anchor: Notify integration partners about events

License:MIT License


Languages

Language:TypeScript 93.0%Language:Makefile 3.8%Language:Dockerfile 3.2%