Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 6.89 KB

README.md

File metadata and controls

61 lines (41 loc) · 6.89 KB

Java Example Catalog

Prerequisites

  • JDK >= 17

Basics

  • Services - Durable Execution: Making code resilient to failures via automatic retries and recovery of previously finished actions.
  • Durable Building Blocks: Restate turns familiar programming constructs into recoverable, distributed building blocks. Discover what you can do with the SDK.
  • Virtual Objects: Stateful services with access to long-lasting, consistent K/V state.
  • Workflows: Durable sequences of steps that can be queried, signaled and awaited.

Use Cases and Patterns

Communication

Orchestration patterns

  • Sagas: Preserve consistency by tracking undo actions and running them when code fails halfway through.
  • Stateful Actors and State Machines: State machine with a set of transitions, built as a Restate Virtual Object for automatic state persistence.
  • Payment State Machines (Advanced): State machine example that tracks a payment process, ensuring consistent processing and cancellations.

Scheduling

  • Scheduling Tasks: Restate as scheduler: Schedule tasks for later and ensure the task is triggered and executed.
  • Parallelizing Work: Execute a list of tasks in parallel and then gather their result.
  • Payments: Async Signals: Handling async payment callbacks for slow payments, with Stripe.

Event processing

Integrations

Examples integrating Restate with other tools and frameworks:

End-to-End Applications

Complete applications built with Restate:

  • Food Ordering App: A food delivery service (like DoorDash) that manages orders, restaurants, payments, and delivery drivers. The example mixes workflows (ordering) and stateful microservices (driver management), and uses Kafka as an event source for updates from delivery drivers.
  • Subway Fare Calculator: A fare calculator for a subway system that calculates the fare based on distances traveled by customers. Implemented as Stateful Actors.
  • Image Workflow Parser & Executor: A dynamic workflow interpreter (Spring Boot) that parses a JSON list of image processing commands and runs them through image processing libraries.

Templates

Starter templates for new projects:

Tutorials

Step-by-step guides to learn Restate: