- 
                Notifications
    You must be signed in to change notification settings 
- Fork 821
Description
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!