Restate sends data over the network for storing state, journaling actions, awakeables, etc. Therefore, Restate needs to serialize and deserialize the journal entries.Documentation Index
Fetch the complete documentation index at: https://docs.restate.dev/llms.txt
Use this file to discover all available pages before exploring further.
Default serialization
The SDK uses by default Jackson Databind for the Java API, and Kotlinx serialization for the Kotlin API. For example, for state keys:Customizing serialization
There are different entrypoints in the SDK to customize (de)serialization, depending on your needs.Custom Jackson ObjectMapper
You can customize the Jackson’s ObjectMapper by subclassing the JacksonSerdeFactory class:
@CustomSerdeFactory:
Custom Kotlinx Serialization Json
You can customize the Kotlinx Serialization Json by subclassing the KotlinSerializationSerdeFactory class:
@CustomSerdeFactory:
Use custom serializer for a specific operation
If you need for a specific operation (e.g. forContext.run or Context.Awakeable) a custom (de)serializer, you can implement one using the interface Serde:
ctx.run:
Use another serialization library
If you want to use a different serialization library throughout your service, we suggest implementingSerdeFactory and annotating the service class with @CustomSerdeFactory. Refer to the Javadocs for more details.