Kafka and Spark Replace REST Calls in a Five-Service Java 21 Checkout Demo
A sample project called ventas-kafka-spark shows how a sale can move through five services without any service calling another directly. Sales, inventory, orders, payments and delivery each consume one Kafka topic and publish the next event, so the overall flow emerges from small topic contracts. A separate Apache Spark job reads payment events later to produce a per-product summary, without changing the payment service. The example uses Java records serialized as JSON via Spring Kafka, and the repository runs with a single start script and includes sequence diagrams. The author argues this choreography design avoids the coupling and error-handling burden of a synchronous call chain when new consumers like analytics are added.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in