Skip to main content
The Java/Kotlin SDK provides an integration module with Spring Boot: your Restate services become Spring beans, so you can use dependency injection, configuration properties, and the rest of the Spring ecosystem.
Get started from a template with the Java (Maven + Spring Boot) or Kotlin (Gradle + Spring Boot) Quickstart.

Dependencies

Use the Spring Boot starter instead of the plain HTTP SDK dependency. It pulls in the SDK and auto-configures the Restate endpoint and client.
Netty version requirement (SDK ≥ 2.9.3)The SDK requires Netty ≥ 4.1.132. Spring Boot’s dependency management may pin an older version and silently downgrade it, causing runtime issues. To fix this:
  • Upgrade to Spring Boot ≥ 3.5.13, which ships Netty ≥ 4.1.132, or
  • Pin Netty explicitly in Maven (<netty.version>4.1.136.Final</netty.version> in pom.xml) or Gradle with the io.spring.dependency-management plugin (netty.version=4.1.136.Final in gradle.properties).

Enabling Restate

Add @EnableRestate to your Spring Boot application:

Defining services

Annotate your service class with @RestateComponent in addition to the usual @Service, @VirtualObject, or @Workflow annotation. Unlike the standalone setup, the service has no main: Spring Boot binds and serves it. @RestateComponent is like any other Spring’s @Component: inject configuration and other beans as usual (@Value, constructor injection, …).
Everything inside the handler works exactly as in the standalone SDK: use the Restate static methods (Java) or the top-level functions in dev.restate.sdk.kotlin (Kotlin) for state, calls, side effects, and timers.

Calling Restate from Spring

The starter registers a Client bean. Inject it into any Spring component (controllers, scheduled tasks, …) to invoke your handlers from outside a Restate context:
In Kotlin, inject the same Client bean through the constructor.

Configuration

Configure the SDK endpoint and the injected client via application.properties (or application.yml):
Service- and handler-level options (retention, timeouts, retry policies, …) are set with restate.components.<ServiceName>.* properties. See service configuration for the full list.