
Develop event-driven microservices with reactive Kafka and Spring Cloud Stream, implementing saga patterns and transactional outbox pattern for a four-service e-commerce workflow.
Explore how Spring Cloud Stream enables message driven microservices by wiring business logic with Spring Cloud Function and its supplier, consumer, and function interfaces to produce and consume Kafka messages.
Learn how a binder creates bindings between your app and a messaging platform using application yaml configuration. Explore producer and consumer roles and multi binding indices and topics.
Set up a spring cloud stream kafka project using start.spring.io with java and maven, include the reactive kafka binder, import to IDE, and reload maven after updates.
Create a simple Kafka consumer with Spring Cloud Stream using a Java functional interface, processing string messages as a flux and binding to a topic and group via YAML.
Set up and verify Kafka by spinning up the server with Docker Compose, creating an input topic, and using the console producer to test message delivery to the running application.
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.
Implement a Kafka consumer as a Spring function returning mono of void for subscription, and use Spring Cloud Function definition to select the function when beans exist, binding to topic.
Learn to enable one package at a time with spring profiles by renaming yaml, setting the active profile to section zero one or section zero two, and validate beans created.
Explore binder properties in Spring Cloud Stream, configuring Kafka with producer and consumer properties and group instance ID through common configuration.
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.
Discover binding specific properties for kafka bindings in spring, including per-binding group instance id configuration via a map, and consumer and producer settings in application.properties or yaml.
Create a simple Spring Cloud Stream producer that emits ten string messages at one-second intervals to an input topic, with a companion consumer and YAML configuration.
Update the spring cloud stream Kafka producer to use minus one (all) acknowledgments via the binding properties for the producer out binding, improving reliability.
Explore sender options customization in kafka event driven microservices, updating the sender option customizer to set producer config acknowledgement to all and adjust batch size.
Explore limitations of the test binder for reactive types, and learn to implement robust integration tests using embedded Kafka and Zookeeper, including error handling.
Explore integration testing strategies for kafka-driven microservices, using embedded kafka with spring cloud streams or kafka sender/receiver, including an abstract test base, test producer, and step verifier validation.
Override test properties with Spring test property source to configure Kafka topic bindings and Spring Cloud function during integration tests, validating producer and consumer flows in a Kafka-based microservices setup.
Write a Kafka producer test in a Spring integration setup, using a test consumer, sink, and step verifier to assert two produced messages on the input topic.
Set a reasonable timeout to prevent tests from waiting indefinitely when a Kafka topic stops producing values, and learn to debug with timeout exceptions in integration tests.
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.
Explore common demo issues in Kafka event-driven microservices by examining producer and consumer behavior, auto offset reset from latest to earliest, and starting from a clean data state.
Build a simple processor that consumes and produces messages, enriching data through simulated third-party calls and uppercasing content, using spring cloud stream with kafka producers and consumers.
Demonstrate a processor that consumes producer output from the input topic and writes to the output topic as a spring cloud function.
Build an integration test for the processor in a kafka event driven microservices setup using spring cloud stream, with distinct request and response sinks and step verifier validations.
Produce and receive Kafka messages with a key by wrapping a string payload in a message, setting Kafka headers and a key, and accessing headers on the consumer.
Learn how to handle keys in Kafka messages with Spring Cloud Stream, using byte array and string serializers, automatic json payloads, and message acknowledgements.
Shows how to perform acknowledgement of messages by using a generic record with key, payload, and receiver offset, and centralizes extraction via a message converter in the Kafka consumer.
See how a producer's plain payload can be consumed as a message, revealing payload, content type, partition, offset, and acknowledgement.
Write a quick integration test for Kafka messages with keys, using a Kafka producer with a message of string, map to record, and assert the key matches the expected value.
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.
Learn how Stream Bridge enables dynamic routing in Spring Cloud Stream, moving beyond static 1-to-1 bindings to route messages to destinations at runtime using content-based decisions.
Navigate stream bridge driven content-based routing to route order events to digital or physical delivery paths. Model order event DTOs with a digital vs physical delivery approach in Java Spring.
Create a Kafka order event producer that emits ten randomized orders with digital or physical type, using a message payload, headers, and a key, and log each emission.
Build a digital delivery consumer (and a parallel physical delivery consumer) as a Spring bean, converting messages to records, logging details, and acknowledging each record.
Explore content based routing in a Kafka event driven microservice by building an order router that uses a stream bridge to dispatch digital and physical deliveries.
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.
Explore dynamic routing with Stream Bridge, routing messages to digital or physical topics based on event content and binding names.
Write an integration test for the router's producer and consumer to verify routing to digital and physical topics, using a test configuration and StepVerifier to validate delivery.
Learn content-based and dynamic routing without stream bridge by sending messages with a destination header to route to digital or physical delivery topics, using Spring Cloud Stream.
Demonstrates dynamic routing with the message destination header and explicit bindings to route to digital and physical topics. Tests confirm header-based routing to digital and physical topics via explicit bindings.
Learn to use stream bridge as a dead-letter topic producer to route error records, configure a processor, map messages, and validate error handling with integration tests.
Explore content based routing and error routing with spring cloud stream. Learn asynchronous sending via the reactive kafka binder, and how headers can replace stream bridge.
Explore the fan out pattern in event-driven microservices, routing a single message to multiple topics (one-to-many), with content-based routing and processor logic to deliver sms and email notifications efficiently.
Demonstrate fan-out in Kafka event driven microservices by routing digital orders to a digital topic and copies to a physical topic. Build a fan-out processor and validate deliveries with tests.
Learn how to fan out messages using the message destination header, returning one or two objects via a flux and destination header, comparing digital vs physical and stream bridge alternatives.
Leverage fan-out with tuples in a reactive Java Spring microservice, transforming order events to digital delivery or physical delivery using Flux, tuple two, and Reactor utilities.
Demonstrate fan-out with tuples in a Kafka microservices workflow, configuring YAML bindings and tests to route processor outputs to digital and physical topics.
Combine temperature and humidity streams from two Kafka topics using reactor combinelatest in a heat index calculator, producing a single output that reflects the feels like temperature.
apply a fan-in test to a two-input processor that combines temperature and relative humidity into a heat index output, verified via temperature and humidity topics and a heat index topic.
Explore configuring content type in Spring Cloud Stream, switchable via bindings, and the trade-off between framework magic and native encoding decoding, with a practical Kafka producer–consumer demo.
Demonstrate native decoding in a Kafka binding by configuring integer deserializers for the consumer, resolving decode mismatches and enabling seamless cross-team data pipelines in Spring Cloud Stream.
Demonstrate encoding and decoding abstract types in Kafka event driven microservices with Java and Spring, using a contact method interface with email and phone implementations.
Learn how json serializer and deserializer use type headers to encode and decode abstract types in Kafka event driven microservices with Spring Cloud Stream, enabling multiple implementations.
Understand how Kafka messages carry a type ID in headers for decoding, while producers use native encoding; avoid star bindings and use explicit package names in Spring Cloud Stream.
Model domain knowledge with an abstract order event and concrete created, modified, and cancelled implementations, carrying order id, product id, customer id, previous and current state, and cancellation reason.
Demonstrates consuming messages from multiple Kafka topics with a single Spring Cloud Stream consumer. It shows using topic lists in code and YAML and explains merged versus separate event processing.
Explore batch processing and error handling in a reactive pipeline with Spring Cloud Stream, including retry, dead-letter topics, and the outbox pattern; note Kafka transaction limitations and reactive Kafka templates.
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.
Explore the saga pattern for coordinating distributed transactions across order, payment, inventory, and shipping services using choreography and orchestrator patterns, with event-driven workflows and rollback scenarios.
Set up a multi-module maven project for Kafka event-driven microservices using the choreography pattern, with a common choreography module shared across five microservice modules.
Set up a multi-module Spring Boot project for Kafka event-driven microservices. Centralize dependencies with dependency management and apply reactive binder and WebFlux where appropriate.
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.
Design a four-service event-driven system with Kafka topics for order, payment, inventory, and shipping events, using choreography and orchestration patterns to handle happy and negative scenarios.
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.
Model domain events and saga workflows for order processing, define a domain event root, an order saga, and order events, and implement with Java records for timestamped event emission.
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 order domain events for Kafka driven microservices by implementing a sealed order event interface, creating events such as order created, cancelled, and completed, with a Lombok builder.
Define payment domain events in a sealed interface for the order saga, including payment detected, refunded, and declined with order id, payment id, customer id, amount, and created at.
Create an unsealed inventory event interface extending the saga domain event, and define inventory detected, restored, and declined records with orderId, createdAt, inventoryId, productId, and quantity.
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.
Define generic event processor interfaces and implement an order event processor, handling created, cancelled, and completed events with pattern matching and Java preview features.
Explore pattern matching alternatives in Java, comparing simple if-else and instanceof-based approaches with method overloading, and learn a custom message handler pattern for method chaining.
Enable Java 17 preview features in a Maven project by configuring the Maven compiler plugin for source 17 and target 17, and enabling the preview option for tests.
Extend the event processor pattern to inventory, payment, and shipping events by implementing interfaces and handle methods for inventory detected, declined, restored; payment detected, declined, refunded; and shipping scheduled.
Create an event publisher in a dedicated package that emits a flux of domain events of type T, enabling the order service to publish events independently.
Learn to handle duplicate Kafka messages using a duplicate event validator and raise an event already processed exception in a reactive mono-based workflow.
Define a root domain event and a saga marker for the order workflow, then implement order, inventory, payment, and shipping events with a specialized order event processor using pattern matching.
Build a customer payment service that deducts and refunds balances based on order events, using a Kafka-driven messaging module and a DTO-based service layer.
Design a Kafka-driven microservice module by structuring entity and repository layers, defining customer and payment entities, DTOs with order ID, a mapper, and reactive repositories for duplicate event processing.
Create a stateless mapper utility to convert payment process requests into customer payments with a builder pattern, and define a service interface for processing and refunds with exceptions.
Implement the payment service, validate duplicate events, verify order and customer existence, check balance, detect payment, and update and persist customer and payment records within a transactional flow.
Implement the refund flow by issuing refunds only when payment is detected and not already refunded, updating the payment status to refunded and increasing the customer balance.
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.
Process order events in the payment service by handling order cancellations with refunds and emitting a payment refunded event. Map message dtos, log refund processing, and gracefully handle errors.
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.
Configure yaml to wire a processor that consumes order events and outputs payment events in the customer payment group, using json value and string key serializers, with data sql initialization.
Develop and run an integration test that emits order events, consumes payment events, and validates payment events using a test data utility, StepVerifier, and assertions on order id and amount.
Explore integration testing for a Kafka-based payment service. Validate customer balances, handle duplicate events, and verify refunds with reactive step verifications and hard publisher streams.
Extend the payment service integration tests to cover cancelled, order created, and missing-entry events, plus customer not found, payment declined, and insufficient balance, and identify reusable test patterns for CI/CD.
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.
Finish the inventory service by consuming order events, emitting inventory events, updating the product and order_inventory tables, deducting or restoring quantity, and implementing out of stock exception with integration tests.
Illustrates the inventory service workflow for a kafka-based microservice, covering detect and restore logic, out-of-stock handling, dto and entity mapping, repositories, and event-driven processing.
Implement integration tests for the inventory service in a Kafka-based microservices setup, validating inventory events such as order created and canceled, quantity updates, duplicate event handling, and out-of-stock scenarios.
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 a shipping service with an entity, dto, and repository to handle order created, cancelled, and completed events, scheduling delivery and emitting shipping events on a Kafka topic.
Implement a shipping service with validation and repository integration, handling create, cancel, and schedule flows by validating orders, setting pending and scheduled statuses, and mapping shipments to a DTO.
Map order created events to schedule requests, convert shipment data to scheduled events, and emit shipping events via a reactive order event processor. Add duplicate-event handling and reuse Kafka configuration.
Learn to write an integration test for the shipping service in a Kafka event-driven microservices setup, copying the inventory test and emitting the completed event.
Demonstrates plan and cancel and plan and schedule tests for the shipping service, validating created and duplicate events yield one shipping-pending record and order id, shipment id, and delivery date.
Implement the order service with a rest controller that records orders as pending and emits order created events to coordinate payments, inventory, and shipping using saga choreography or orchestrator patterns.
Design entities, dtos, and repositories for the order service, mapping create requests to purchase orders and converting entities to dtos, with repository methods like find by order id and status.
Define interfaces for a controller, messaging, and order service to support order creation, order details retrieval, and cross-service updates (inventory, payment, shipping) via order created events.
Implement the order service with entity mappers, persist orders via repository, and emit order created events; fetch order details by id using parallel mono calls to payment and inventory components.
Implement a payment component service that provides a payment component fetcher and status listener, querying by order id and updating status on success or rollback with idempotent handling.
Implement the inventory component service by wiring the inventory fetcher and status listener, mapping order inventory DTOs to entities, persisting success or failure, and handling rollback.
Clarify performance choices for order details by comparing single database joins versus parallel component fetches, using payment and inventory fetchers in Java and Spring.
Implement the shipping component service to update the delivery date for completed orders by finding the order via the repository and saving the updated entity.
Create an order fulfillment service that decides when to complete or cancel orders, cancel on component failure, and coordinate inventory and payment statuses before completion.
Implement the order fulfillment check by validating pending status and all components' completed states, using a single SQL join or parallel queries, and explore repository and projection options.
Organize the messaging mapper into inventory, payment, and shipment mappings, converting messages to DTOs and producing corresponding events. Clarify declined messages to capture why declines occur.
Implement inventory and payment event processors in a Kafka-based order service, wiring status listeners and event mappers to emit order completed or cancelled events via fulfillment service and handle rollback.
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.
Implement a dedicated order event publisher and listener to emit order created events to a sink, using emit next with retry for reliability in a Kafka event-driven microservices setup.
Explore Spring Cloud Stream binding config patterns, refactor to minimize bindings using destination header routing, and route messages to a single binding across inventory, order, and payment processors.
Refactor the Spring Cloud Stream bindings by introducing an abstract order event router and concrete processor configs for inventory, payment, and shipping events, routing outputs to the order events channel.
Configure Spring Cloud Stream binding for order events, implement an order event publisher and listener, map messages, and add debug logging to trace sync and flex streams part 3.
Copy and modify the application yaml from other projects, note processor and producer names, and configure the order events channel to route to payment, inventory, and shipping bindings.
Develop a spring rest controller for orders, with post mapping to place orders and return 202 accepted, plus endpoints to fetch all orders and a specific order by uuid.
Verify the application bean creation and ensure the main application runs smoothly, addressing any Spring Boot dependency injection issues that may arise.
Write an integration test for the order service using the web test client to post a create request and validate the order created event and pending status.
Refactor an end-to-end integration test by moving logic to an abstract base, enabling reusable initiate order, event verification, and stream bridge emissions for payment, inventory, and shipping events.
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.
Resolve concurrent event processing issues by applying optimistic locking with a version column on the purchase order table, preventing duplicate completions from payment and inventory processors after simultaneous events.
Enable optimistic locking by adding a version column and @Version annotation, then retry on optimistic locking failures in the order fulfillment flow to ensure a single completed event.
Master integration testing of a Kafka event driven order workflow by emitting a shipping scheduled event via stream bridge, validating order details through a rest call and handling asynchronous delivery.
Create an integration test for the order canceled workflow, validating payment detected with inventory declined and the resulting order canceled event.
Add an integration test for a compensating transaction when payment is declined and inventory is restored, validating order cancellation, no shipping, and restored inventory state.
Implement an integration test to verify get all orders endpoint returns a list of purchase orders via a parameterized type reference, and clear the dirty context with a before method.
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.
Orchestrate resilient commerce with Postman driven tests to simulate inventory, payment, and shipping interactions; demonstrate saga choreography by handling out-of-stock, declined payments, and inventory restored.
Watch a final demo of saga pattern choreography in an order service workflow, showing how cross-service events handle customer, product, and inventory failures and rollbacks.
Demonstrates saga pattern choreography through a parallel, concurrent requests test that places three thousand orders, checks balance and inventory, and handles cancellations and refunds.
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.
Explore the orchestrator pattern for saga-driven distributed transactions in a Kafka-based microservices app, showing how the order service coordinates payment, inventory, and shipping via commands and events.
Set up the saga orchestrator project by organizing packages for customer, payment, inventory, order, and shipping services, replacing choreography with the orchestrator, then build with mvn clean package.
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.
Model payment messaging with a sealed payment request (process and refund) and a payment response (processed or declined), including order id, customer id, and amount.
Model inventory and shipping request and response modeling with sealed interfaces, track states like detected, restored, scheduled, and declined, and include order id, product id, quantity, and delivery date.
Model request processors for the customer, payment, inventory, and shipping services using the choreography pattern and define a processor interface with a process method returning a mono of action.
Revisit the choreography pattern by reusing existing services to implement a request-response style service that acts as an orchestrator, with boring but essential steps to enable a demo.
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.
Configure the payment request processor to receive payment requests and respond with payment responses as messages, log processing steps, and handle errors in a Kafka-based Java Spring microservice.
Build an integration test for the payment service using stream bridge to emit payment requests and verify payment responses, while handling refunds and avoiding duplicate events.
Execute integration tests for the payment service, validating process and refund flows, balance updates, handling duplicate messages, and error handling for not found customers or insufficient balance.
Detail the inventory service implementation, including choreography migration to common messages, message mapper, request processor, detect and restore flows, and integration tests.
Ship service for the orchestrator pattern handles a schedule request, records a delivery date into the shipment table, and responds scheduled or declined based on a nine-item limit, simulating declines.
Implement the shipping service by replacing common events with messages, adding a shipment quantity limit exceeded exception, validating duplicate requests, and mapping and saving shipments when quantity is under ten.
Refine the message mapper for shipping and scheduled requests/responses, wire the shipping request processor, and adjust config and topics in shipping service implementation part 2.
Develop and validate the shipping service with an integration test that covers schedule, duplicate, and decline scenarios using stream bridge, test data util, and robust assertions.
Design and implement the order service as an orchestrator for a multi-step workflow, handling happy path and cancel scenarios, persisting pending orders with 202 accepted and enabling rollback on failures.
Model and connect workflow steps by defining interfaces for sending requests, compensating actions, and processing responses using reactive publishers, guided by an order id and a common orchestrator package.
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.
Implement an entity data mapper in the order service to convert an order create request to a purchase order, then build workflow action and order details with timestamps.
Define service interfaces for order management, including controller-facing actions, a messaging layer interface for workflow tracking, and a retrieval interface to feed the orchestrator with order workflow actions.
Learn to implement the order service and order fulfillment service, map entities to DTOs, emit order events, build order details, and update statuses with a reusable update method.
Implement the workflow action service and repository methods, fetch actions by order id and by created at, and validate duplicates before saving mapped order workflow action data for the orchestrator.
Add the controller by copying the saga pattern choreography code into the controller package, preserving the same endpoints and method calls.
Develop the message dto mapper and orchestrator to send payment processing, refund, inventory restore, shipping requests, using order id to fetch purchase order details and extract delivery date for shipments.
Define the payment, inventory, and shipping step interfaces to model the workflow. Define on-success and on-failure methods to route processed and declined responses, paving the way for the orchestrator.
Implement the payment step in the orchestrator by wiring the Impel implementation with the workflow action tracker, order fulfillment service, and message mapper to send payment requests and refunds.
Implement the inventory step in the Kafka event driven microservices, including inventory detect and restore requests, compensation flow, and sequencing logic controlled by the orchestrator.
Handle on success and on failure in the payment workflow by tracking responses and order ID, notifying the next step, and compensating previous steps using mono and then many.
Implement the shipping step by building a shipping stub that processes order id, triggers shipping schedule via the tracker, and saves the schedule to the purchase order table.
Design a workflow orchestrator interface using a publisher of request and reactive streams to route payment, inventory, and shipping responses.
Implement an order fulfillment orchestrator that wires payment, inventory, and shipping steps, enabling dynamic response handling and flexible step sequencing while balancing extra db calls.
Design a Kafka event driven workflow builder that chains first and last steps with next, and handles success and failure using a function and Mono.
Implement an order event listener in the service layer to emit purchase orders via the order event, aligning saga choreography with a uuid-based publisher for the first workflow step.
define the order fulfillment orchestrator config for kafka event driven microservices, creating payment, inventory, and shipping channels, and route messages via destination headers using a reactive flex flow.
Design and implement an integration test for the order service using stream bridge, capturing requests (payment, inventory, shipping) and emitting responses, while reusing and updating test constructs for saga choreography.
Develop and validate a complete end-to-end integration test for the Kafka event-driven order workflow, covering create, pending validation, payment, inventory, shipping, and final completion with action tracing.
Explore integration testing of negative scenarios in a Kafka event-driven microservices flow using Java + Spring, covering payment, inventory, and shipping declines, refunds, and restores.
Demonstrate the Kafka-based saga orchestrator pattern in a microservices setup, from Docker Compose start to end-to-end order processing, including payment, inventory, and shipping events, cancellations, and refunds.
Shows an orchestrator in a saga choreography for Kafka event-driven microservices with Java and Spring, guiding end-to-end order flow from placing to completion, including payment, inventory, shipping, and refunds.
Switch the orchestrator workflow steps—inventory, shipping, and payment—and verify with happy-path and failure scenarios, restarting apps to observe inventory restoration when a step declines.
Run the concurrent requests test for the orchestrator with 3000 requests, validating payment and inventory declines, refunds, and resulting completed orders on the Kafka-driven system.
Saga patterns manage distributed transactions across microservices using choreography or orchestrator styles. The orchestrator coordinates steps, while choreography emits events and reverts local transactions on failure, aiding debugging.
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.