Differences in Serializing Event Messages between Axon 2 and Axon 3

Hi,

Using the default XStreamSerializer for serializing domain events there’s a change in the xml format when comparing output of Axon 2 to Axon 3,
see below for an example. What’s especially striking in the Axon 3 format is the timestampSupplier tag, which looks like a serialized lambda. That triggered
me to question the xml format because I expect just a timestamp to be communicated and not the implementation details of the supplier.
Can someone tell me whether this xml format is indeed the default xml format for Axon 3 or that I misconfigured something on my end?
If this is the correct format can someone explain why the timestampSupplier is in there?

Cheers,

Frank

Serialized xml message (Axon 2):

<domain-event> <identifier>774674a1-688f-4dd5-ab5a-9b74daa31ecc</identifier> <metaData/> <payloadType>a.b.c.Something</payloadType> <payload class="a.b.c.Something"> ... </payload> <timestamp>2017-03-07T16:03:58.700+01:00</timestamp> <aggregateIdentifier class="string">72095c52-4bd3-4aba-88fe-5660590a98db</aggregateIdentifier> <sequenceNumber>66</sequenceNumber> </domain-event>

Serialized xml message (Axon 3):

`


42f0feb8-3b7a-4dc1-9439-b04408879d8c


traceId
4fc04b76-7adb-4fe6-8224-52075b0483e3


correlationId
4fc04b76-7adb-4fe6-8224-52075b0483e3


a.b.c.Something





<org.axonframework.serialization.CachingSupplier>


2018-08-31T14:57:41.410Z


</org.axonframework.serialization.CachingSupplier>

User
72095c52-4bd3-4aba-88fe-5660590a98db
66

`

To clarify, this doesn’t happen on a database level but happens when we try to process EventMessages through the XStreamSerialzer.

Have a look at the SpringAMQPPublisher. Instead of serializing the message at a whole, consider serializing the payload and meta data (incl custom metadata) separately.

The message format has indeed changed a little between major releases, to improve deserialization performance when event timestamps are not being requested.

Hope this helps.
Cheers,

Allard