Repository navigation
v2.10.0
Restate Java/Kotlin SDK 2.10.0
Journal encryption with PayloadCodec
The new PayloadCodec interface lets you transform journal payloads after serialization and before deserialization. The typical use case is service-side journal encryption: Restate only ever stores and sees the encoded bytes.
The codec is applied to handler input and output, ctx.run results, call/send parameters and call results, awakeable/promise/signal results, and state values.
Failures (e.g. terminal error messages), state keys, headers and other metadata are not encoded.
Implement encode(Slice) / decode(Slice), then configure the codec on the endpoint. Requests and responses are encoded too, so configure the ingress Client with the same codec:
PayloadCodec codec = new MyPayloadCodec();
// Applied to all the services bound to this endpoint
RestateHttpServer.listen(Endpoint.bind(new Greeter()).withPayloadCodec(codec));
// Ingress client
Client client = Client.connect("http://localhost:8080", null, codec, null);With Spring Boot, just declare a PayloadCodec bean in any of your @Configuration classes: it is picked up both by the Restate endpoint and by the auto-configured Client.
@Configuration
public class RestateConfiguration {
@Bean
public PayloadCodec payloadCodec() {
return new MyPayloadCodec();
}
}Check out the AWS KMS example for a complete codec implementation using AES-GCM-256 and AWS KMS.
NOTE:
PayloadCodecrequires the new state machine, available on JDK 23+
DurableFuture fixes
DurableFuture (both Java and Kotlin) was reimplemented, fixing several issues with mappers and combinators. There's few behavior improvements to be aware of:
- Mappers (
map,mapFailure) now run lazily on the thread/coroutine awaiting the future, rather than eagerly on another thread (Java) or a launched coroutine (Kotlin). Context operations inside a mapper (e.g.ctx.set, awaiting other futures) are now correctly ordered and deterministic on replay. - Mappers don't run anymore for futures that are never awaited, nor on the losing branches of
DurableFuture.any/select. - In Java,
DurableFutureis now a sealed interface instead of an abstract class.
Integration client
The new dev.restate:integration-client module lets you turn any source of events into Restate invocations through the Integration API, including exactly-once ingestion for sources with stable offsets. This API is in Preview and it might change in subsequent releases.
Check out the documentation to get started.
Other changes
- Shared core bumped to 8.0.0.
- Dependency bumps. Kotlin 2.4.21, KSP 2.3.12, kotlinx-coroutines 1.11.0, kotlinx-serialization 1.11.0, nimbus-jose-jwt 10.10, Tink 1.23.0.
Full Changelog: v2.9.4...v2.10.0