
Start the Kafka-based application, verify the server runs on localhost 9092, and watch a simple consumer receive typed messages like 'Hello World' in real time.
Configure Kafka receiver options with a beam binder by supplying a receiver options customizer, adjust consumer config like group instance id, and test binding-specific settings for function-in-zero.
Explore how to handle message delivery in Kafka with correlation IDs, confirm successful sends, and apply the outbox pattern for reliable event publishing in Spring Cloud Stream.
Demonstrate a processor that consumes producer output from the input topic and writes to the output topic as a spring cloud function.
Explore Spring Cloud Stream for event driven microservices with Kafka, producing and consuming messages wrapped in a Spring message with headers, using supplier, consumer, and function with bindings.
Configure a runtime content-based routing pipeline using spring cloud function bindings and stream bridge to route messages to digital and physical topics.
Run the demo to observe content-based routing in a Kafka microservices setup, with topics auto-created, messages produced and consumed by digital and physical processors.
Enable flexible kafka message handling with default json content, the object mapper, and customizable content types, plus native encoding and multiple topics for reactive spring cloud stream microservices.
Run maven clean compile in the terminal to download dependencies and verify a successful build, whether you used the template or a setup, then reload Maven and refresh the IDE.
Explain when to emit rollback events in a saga and how refunds trigger event-based confirmations, then contrast event-driven microservices with rest patterns in maintaining consistent state.
Explore how Java 17's sealed modifier restricts class hierarchies to only the permitted subtypes, using interfaces, abstract classes, and records to model domain events like order created, cancelled, and completed.
Define shipping domain events, implement shipping event interface, and model a shipping saga with order id, shipment id, instant created, and an enum from pending to scheduled.
Explore building a Kafka-driven payment service: configure messaging, create an event mapper, process order created events into payment requests, and emit payment events, with debugging prints.
Configure spring cloud stream to process order events into payment events with a reactive flux pipeline, including message conversion, acknowledgment, retry, and dead letter topic handling.
Refactor the payment service integration tests to use reusable event assertions for event and no-event scenarios. Leverage a generic type and verifier to streamline tests and improve clarity.
The shipping service handles order created and completed events, maintains a shipments table, schedules labels via Fedex or DHL, and supports cancellations, illustrating saga pattern and event carried state transfer.
Implement the shipping event processor for order events in a Kafka, Java and Spring microservices setup, and explore using a shipping event consumer with a Mono.empty response.
Write and run an integration test to simulate end-to-end order processing, emit payment detected and inventory events, and verify order completed events while diagnosing duplicates and timing bugs.
Explore a hands-on demo of saga choreography in a Kafka-backed event-driven microservices setup, running end-to-end order, inventory, shipping, and payment flows with live event logs.
This lecture explains how the saga choreography pattern enables distributed transactions through event-driven microservices that observe events and react, using asynchronous messaging across inventory and payment services.
Create an orchestrator by establishing a messages package with request and response interfaces for the order saga, modeling domain events like payment process and payment declined.
Copy and refactor the customer payment module into the guru payment package, converting the messaging layer from events to messages and implementing payment process requests to processed or declined responses.
Designs a simple order service schema with a purchase order table and order workflow action log, defines order status and workflow action enums, and builds entity, dto, and repository layers.
This course is specifically designed for senior or staff-level engineers who are interested in learning about Event-Driven Microservices, the Saga Pattern, and various architectural patterns using technologies such as Spring Cloud Stream, Kafka, and Java Reactive Programming.
By the end of the course, participants will gain a deep understanding and comfort with the following patterns:
Saga Choreography Pattern
Saga Orchestrator Pattern
Transactional Outbox Pattern
Fan-Out / Fan-In
Content-Based Routing / Dynamic Routing
Here is what we will do in this course:
The course begins by exploring Spring Cloud Stream, a framework for developing Event-Driven Microservices. Participants will learn how to use the Reactive Kafka binder and practice producing, consuming, processing, and acknowledging messages using Java Reactive and functional interfaces. Integration tests using Embedded Kafka will also be covered.
Next, participants will delve into Stream Bridge, a utility for sending arbitrary messages to a Kafka Topic. Stream Bridge enables routing messages based on content, achieving dynamic routing, and even acting as a Dead-Letter-Topic producer during error handling.
The course then progresses to designing a complex application involving multiple microservices. Participants will learn how to achieve a complex workflow that involves all the services, with a focus on implementing the Saga Pattern. The Saga Orchestrator and Saga Choreography styles will be explored, where participants will understand the role of a central coordinator or the observation and reaction of events among the saga participants.
Finally, the course covers the Transactional Outbox Pattern, which addresses reliable message sending to a Kafka Topic. The pattern involves the use of an 'Outbox' table acting as a proxy Kafka topic. Messages intended for the Kafka topic are first inserted into this table as part of the application's database transaction. Periodic querying of the table ensures messages are sent, marked as 'Sent,' and not sent again.