Skip to content

Is it necessary for the AbstractMessagingMessageConverter/SqsMessagingMessageConverter to send the JavaType header? #1036

Answered by tomazfernandes
kevinmcp123 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kevvvvyp, thanks for the issue and detailed explanation.

You're right in that the framework does deserialization in two places - the first is when the message is received, and the other is when the message gets to the listener method.

The reason for this is the listener method is dynamic, so it's not so simple to know beforehand the type the payload should be mapped to.

If the first deserialization succeeds, this means you will get a deserialized payload in components such as ErrorHandler and Message Interceptor, otherwise you'll get the JSON and only the proper POJO in the listener method.

This is a similar behavior to what happens in e.g. Spring for Apache Kafka.

If you're not inter…

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kevinmcp123
Comment options

Answer selected by kevinmcp123
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@kevind-wgu
Comment options

@gabrielevi10
Comment options

@tomazfernandes
Comment options

@kevind-wgu
Comment options

@LeonPatmore
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants