AxonFramework / extension-kotlin

Axon Framework extension for Kotlin integration to ease development in Kotlin.
https://axoniq.io/
Apache License 2.0
43 stars 9 forks source link

Kotlin Serializer implementation #13

Closed Blackdread closed 2 months ago

Blackdread commented 4 years ago

I have not looked into it yet but I think it can be useful to provide something similar to JacksonSerializer/XStreamSerializer/etc using kotlinx.serialization.

Since I had issues with Jackson with default values and inline class: event changes

Using kotlinx.serialization may be a better solution. If not mistaken, they do not support inline class yet but it will come later for sure.

I will try an implementation later of org.axonframework.serialization.Serializer using kotlinx.serialization.

smcvb commented 4 years ago

If you go down this route, @Blackdread, make sure the provided serializer works as expected for every object the framework serializes and deserializes at any point in the code base.

Added, if you could share some benefits of providing a KotlinSerializer which implements Axon's Serializer interface, that would be very helpful to understand your stance and drive behind this issue.

sandjelkovic commented 3 years ago

Kotlin serialization has reached a first stable release https://github.com/Kotlin/kotlinx.serialization/releases

hiddewie commented 3 years ago

See #124. I added a basic implementation of a Kotlin serializer that works with the Axon interface. There are test cases to demonstrate how it works.

Ref https://kotlinlang.org/docs/serialization.html with basic overview. Ref https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serialization-guide.md with serialization guide.

I can give some benefits of the Kotlin Serialization approach:

A possible disadvantage is the compiler plugin that is needed to generate the serialization implementation for each class.

smcvb commented 2 years ago

I've adjusted the milestone to 0.3.0 instead of 0.2.0.

The intent for this is the desire to release 0.2.0 of the Kotlin extension. We felt we couldn't wait much longer until this release.

lion7 commented 2 months ago

I know this is a very old issue, bit this is fixed with https://github.com/AxonFramework/extension-kotlin/pull/338 :)

hiddewie commented 2 months ago

Very nice, thanks @lion7!