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.