axonaxon-framework

Axon stores events as XML instead of JSON


I'm new on Axon framework and i want to configure Axon in order to store events as JSON. I'm using Spring-Boot and, as per documentation, i set some key/value in a .properties file

enter image description here

I expected to see events stored as JSON but i keep seeing XML in the serializedPayload of the MongoDB event store. I think I have configured the serilializers correctly but obviously I'm doing something wrong

Please note that debugging the application it seems that JacksonSerializer class is never invocated and instead XStreamSerializer class is called even my key/value configuration. So i need to understand why my jackson configuraton is not calling the right serializer


Solution

  • Even if the documentation doesn't seem to mention it, it is not enough to add the key/value in the .properties file. You need also to add the JacksonSerializer to the MongoEventStorageEngine as following:

    enter image description here