Creating an HTTP endpoint
- Use either or as SDK dependency.
- Create an endpoint
- Bind one or multiple services to it
- Listen on the specified port (default
9080) for connections and requests.
On JDK 23+, the SDK uses a native library and prints a native-access warning at startup. To silence it, enable native access by passing
--enable-native-access=ALL-UNNAMED as a JVM argument, or by setting Enable-Native-Access: ALL-UNNAMED in your JAR manifest.Creating a Lambda handler
- Use either or as SDK dependency.
- Extend the class
BaseRestateLambdaHandler - Override the register method
- Bind one or multiple services to the builder
Handler execution
For Java services, the SDK uses virtual threads by default on JDK 21 and newer. On older JDK versions, it falls back toExecutors.newCachedThreadPool().
Kotlin services use Dispatchers.Default by default.
Customizing the handler executor
Customizing the handler executor
Override the Java executor or Kotlin coroutine context when your service needs a different execution model: