Integration with Kotlin-First Framework

Is Axon framework readily “integrable” with all the features that make Axon special with a Kotlin-first framework like Ktor?

I don’t know about Ktor, but I implemented a service with Axon in Kotlin with no problems. You will have to forego the niceties of Axon’s Spring Boot integration and configure everything manually, but it should work and be just as “special”.

The only thing that bugged me was the need for no-args constructors for aggregates. This basically forces you to implement attributes (even the aggregate ID) as nullable vars. It’s the same in Java, of course, but in Kotlin I usually expect better null safety.

Although a little off topic perhaps, I still wanted to share that Axon Framework 5 will resolve this. As of that version, entities/aggregate can be mutable or immutable :slight_smile:

Kotlin’s co-routines are not something you can propagate as a message handling response, sadly enough. This has to do with Axon Framework’s use of the ThreadLocal to store a reference to the active Unit of Work (the component processing every message). This discrepancy will change with Axon Framework 5, however.