Question regard serializable events

Hi All,
Our team has upgraded our app from axon 2 to Axon 3. As we noticed that in the document https://docs.axonframework.org/v/3.0/part1/messaging-concepts.html#events
there is a statement

You are highly encouraged to make sure all Events are serializable.

However, there is no explanation why this is the case. And we have observed no obvious drawbacks if we do not implements Serializable.

Can someone elaborate the reasoning behind this? Thanks.

How easy is the upgrade from 2.x to 3.x? We are also planning for it. Is there a migration guide available?

Thanks,

Brijesh

Hi YangYang,

with events being ‘serializable’, we don’t explicitly mean “implement Serializable” in Java. Instead, you must make sure that the event can be serialized using the Serializer that you wish to use. XStream can serialize just about anything, so that’s not a good means of measuring. Generally, it’s just good practice to only store “simple” data in your events and not give them too much structure.

@Brijesh Migrating from 2 to 3 is pretty easy, on a code level. It mainly depends on the number of custom components you have built. The Event Store now has one extra column (auto-increment), but other than that, it’s identical.

Cheers,

Allard