Skip to content

Add order-fulfillment-compensation example#493

Open
mcruzdev wants to merge 6 commits into
quarkiverse:mainfrom
mcruzdev:issue-471
Open

Add order-fulfillment-compensation example#493
mcruzdev wants to merge 6 commits into
quarkiverse:mainfrom
mcruzdev:issue-471

Conversation

@mcruzdev
Copy link
Copy Markdown
Member

@mcruzdev mcruzdev commented Apr 28, 2026

This pull request introduces a new example project, order-fulfillment-compensation, which demonstrates the Saga (compensation) pattern for distributed transactions using Quarkus Flow. The example includes a complete workflow implementation, real-time UI updates via WebSocket, and comprehensive documentation to help users learn about error handling and compensation in distributed systems.

The most important changes are:

New Example Project: Order Fulfillment with Compensation

  • Added a new Maven module (pom.xml) for order-fulfillment-compensation, specifying dependencies on Quarkus, Quarkus Flow, WebSockets, and test libraries.
  • Created a detailed README.md explaining the Saga pattern, compensation logic, workflow steps, test scenarios, architecture, and extension ideas for the example.

Workflow Implementation

  • Implemented OrderFulfillmentWorkflow.java, which defines the order fulfillment process using Quarkus Flow's fluent DSL, including try-catch blocks for each step, compensation functions, and error handling strategies.
  • Business logic methods simulate success and failure for stock reservation, payment processing, and shipping, with compensation methods that cascade rollbacks as needed.
  • Integrated real-time workflow state broadcasting via WebSocket to the UI for live visualization of workflow progress and compensation.

Closes #471

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev requested a review from a team as a code owner April 28, 2026 16:14
@mcruzdev mcruzdev marked this pull request as draft April 28, 2026 16:26
mcruzdev and others added 2 commits April 30, 2026 17:48
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev marked this pull request as ready for review April 30, 2026 21:50
@mcruzdev mcruzdev added ⚠️ DO NOT MERGE DO NOT MERGE THIS PR! labels May 5, 2026
mcruzdev and others added 2 commits May 6, 2026 19:18
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev removed the ⚠️ DO NOT MERGE DO NOT MERGE THIS PR! label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new examples to demostrate compensation with Quarkus Flow

2 participants