-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query responses are serialized with the Default Serializer instead of the Message Serializer #2229
Comments
Thanks for drafting this concern with us, @Arnaud-J. Nonetheless, you are correct in this, and honestly, I need to figure out why this is the case. My apologies for any inconvenience this might have caused you! |
Hi @Arnaud-J, I've checked with the rest of the team, confirming the guess I had. Theoretically, the Due to this the
So you are right, this is intentional. Just out of curiosity but would you be up for drafting an issue for this, so that we do not forget? |
Hi @smcvb! Thanks for confirming. I created the issue for the reference guide as requested. Also, I would like to question the choice of using the default serializer for Thus, to my understanding, we would tend to share theses response classes in the code (probably in a
What do you think? |
Thanks for raising your concerns here, @Arnaud-J! Communication is key for us to improve the product suite. The I would thus expect the Does this clarify the intent of the |
Ah I think I get it! Thanks for taking the time to explain. I indeed have a
@smcvb Is this scenario correct? |
In the core, this is correct, @Arnaud-J, although the ordering is slightly different.
|
Everything makes sense in my head now! Thank you again for taking the time to give so much details! |
Basic information
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!
The text was updated successfully, but these errors were encountered: