A checkout usually starts as one service calling the next: sales calls inventory, inventory calls orders, orders calls payments. It works until one of them is slow, down, or needs a second consumer. Then every caller has to know about every callee.
In ventas-kafka-spark I took the opposite route. One sale goes through five services (sales, inventory, order, payment, delivery) and none of them calls another one . Each service listens to one Kafka topic, does its job and publishes the next event. When the sale is done, a separate Apache Spark job reads the payments and prints a summary per product.
The whole thing runs with one command ( ./start.sh ), and the repo includes sequence diagrams in English and español .
The problem with a chain of calls
With synchronous calls, the sales service owns the whole flow. It has to know the address of inventory, wait for it, handle its errors, then do the same for orders, payments and delivery.…