Skip to content

Query responses are serialized with the Default Serializer instead of the Message Serializer #2229

@Arnaud-J

Description

@Arnaud-J

Basic information

  • Axon Framework version: 4.5.8
  • JDK version: 11
  • Complete executable reproducer if available (e.g. GitHub Repo):

Steps to reproduce

This scenario describes what I was doing at that time, but it can be reproduced in many other ways.

My Event Serializer and Message Serializer (as defined in the doc) are configured to use Jackson. I do not configure the default Serializer, meaning it will use the XStream implementation by default.

I implemented a PageResponseType as explained in this issue comment for my query responses.

When sending a query expecting a PageResponseType response, I ended up with an XStream security exception.

Expected behaviour

I expected XStream not to be involved in the serialization of the response, but rather Jackson because I configured a Message Serializer for Axon Framework.

Actual behaviour

XStream was used as a serializer implementation, meaning Axon's default Serializer was used, resulting in an error in my case (because I did not explicitly configure XStream to allow my response class, but this is another matter).


To summarize, reading the docs made me believe that the Message Serializer would be used for Query messages AND Query responses, but it seems to be used only for the Query message, leaving the Query response to the default serializer.
Is this intentional? If yes, then this issue should not be a bug report but I would really like to see this explained in the documentation.

As a side note, this behavior may be the same for Command responses, but I did not test it.

Cheers!

Metadata

Metadata

Assignees

Labels

Priority 4: WouldLowest priority. Would-be-nice to include issues when time allows it.Status: ResolvedUse to signal that work on this issue is done.Type: BugUse to signal issues that describe a bug within the system.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions