This is the Restate Java/Kotlin SDK (dev.restate), a polyglot JVM SDK for building services on the Restate platform. It provides APIs for durable execution, virtual objects, workflows, and more.
- Gradle 9.3.0 with Kotlin DSL (
*.gradle.kts) - Java 17 toolchain (minimum target)
- Dependencies managed via version catalog:
gradle/libs.versions.toml - Convention plugins in
buildSrc/src/main/kotlin/
./gradlew build # Full build + tests
./gradlew test # Run tests only
./gradlew :sdk-core:test # Run a single module's tests
./gradlew spotlessApply # Auto-format all code
./gradlew spotlessCheck # Check formatting (runs in CI)
./gradlew :sdk-aggregated-javadocs:javadoc # Generate Java docs
./gradlew :dokkaHtmlMultiModule # Generate Kotlin docsAlways run ./gradlew spotlessApply before committing — CI will fail on formatting violations.
- Java: Google Java Format (enforced via Spotless)
- Kotlin: ktfmt (enforced via Spotless)
- Gradle Kotlin DSL: ktfmt (enforced via Spotless)
- License headers: Required on all
.java,.kt, and.protofiles (template inconfig/license-header)
Do NOT manually format code — let Spotless handle it.
sdk-common— Shared interfaces and utilities (Java + Kotlin)sdk-api— Public Java API (dev.restate.sdk)sdk-api-kotlin— Public Kotlin API (dev.restate.sdk.kotlin)sdk-core— Core state machine implementation (shaded jar)sdk-serde-jackson— Jackson serialization supportsdk-serde-kotlinx— Kotlinx serialization support
sdk-http-vertx— Vert.x HTTP serversdk-lambda— AWS Lambda integrationsdk-spring-boot/sdk-spring-boot-starter— Spring Boot integration
sdk-api-gen— Java annotation processor (Handlebars templates)sdk-api-kotlin-gen— Kotlin Symbol Processing (KSP)sdk-api-gen-common— Shared codegen utilities- Annotations:
@Service,@VirtualObject,@Workflow
sdk-java-http,sdk-java-lambda,sdk-kotlin-http,sdk-kotlin-lambda
client/client-kotlin— Admin clientsadmin-client— Admin API clientsdk-request-identity— JWT/request signingsdk-testing— TestContainers-based test utilities
test-services— Test service implementationssdk-fake-api— Mock API for unit tests
- Framework: JUnit 5 (Jupiter) + AssertJ
- Integration tests: Use TestContainers with Restate Docker image
- CI matrix: Java 17, 21, 25
- Tests live in
src/test/javaorsrc/test/kotlinwithin each module
- Package root:
dev.restate.sdk(Java),dev.restate.sdk.kotlin(Kotlin) - Java compiler flag
-parametersis enabled for annotation processing - Generated code goes to
build/generated/ - Proto files in
src/main/service-protocol/ - The
sdk-coremodule uses Shadow plugin to shade dependencies
sdk-coreis the most sensitive module — it contains the state machine that drives durable execution. Changes here require careful review.sdk-apiandsdk-api-kotlinare the public API surfaces. Changes here affect end users directly — maintain backward compatibility.sdk-coreshading: Dependencies are shaded via the Shadow plugin, so shaded classes won't appear at their original package paths in the final jar.- Proto files in
sdk-core/src/main/service-protocol/define the Restate wire protocol — these come from an external spec and should not be modified without coordinating with the protocol definition.
- Do NOT edit files under
build/generated/— they are produced by annotation processors and KSP. - Do NOT manually edit formatting — run
./gradlew spotlessApplyinstead. - Do NOT modify proto files without understanding the upstream protocol spec.