Re:Apply Unix Principles to Write Testable Microservices
by redact207 on Friday April 12, 2019 @01:33AM
(#19642238)
The workflow/orchestrator pattern is key to keeping services decoupled and simplifying your code. I'm working on a Typescript library to encapsulate all the technical detail in https://github.com/node-ts/bus/tree/master/packages/bus-work... so that you only worry about message inputs and outputs keeping it easy to see the logical flows of your system.
The author also hints about an alternative, commonly known as "routing slips" (https://www.enterpriseintegrationpatterns.com/patterns/messa...), where the "next step" is loaded into the message header and gets passed down to the next handler as part of a broader process. This removes the need for a centralised orchestrator, but has a huge downside of being tough to handle failure paths, compensating logic or switching logic.
It's Inspired from the EIP pattern (https://www.enterpriseintegrationpatterns.com/patterns/messa...) and frameworks from other languages that have had this type of thing for years.
The author also hints about an alternative, commonly known as "routing slips" (https://www.enterpriseintegrationpatterns.com/patterns/messa...), where the "next step" is loaded into the message header and gets passed down to the next handler as part of a broader process. This removes the need for a centralised orchestrator, but has a huge downside of being tough to handle failure paths, compensating logic or switching logic.