DEV Community

tq-bit
tq-bit

Posted on • Updated on

Question: Webhooks in a Node-Express app

Hello guys,

I have recently found out about webhooks and was curious if they are viable for microservice composition over http.

In a nutshell, the full requirement is to transition from a monolithic application structure into a modular one. Each microservice is responsible for its own state, but some of the underlying databases share i/o dependencies.

My initial idea was to extend the builtin EventEmitter module with controller classes which, upon successful execution of the business logic, emit the calculated result. 'Elsewhere' within the same project, this event could be caught and its payload would be sent to a related API endpoint with an http request.

What are your thoughts? Have you ever implemented such a use case? How did you plan it out? What problems did you face?

Discussion (0)