Skip to content
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

MappingJackson2MessageConverter doesn't check if payload assignable to target type #22386

Closed
tdorzhi opened this issue Feb 8, 2019 · 1 comment
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Milestone

Comments

@tdorzhi
Copy link

tdorzhi commented Feb 8, 2019

Given object with usual toString implementation (for example Foo(field1=SomeString) and sending it to messageChannel using MessageBuilder#withPayload factory method results in above mentioned line to be executed, which predictably throws

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 8, 2019
@rstoyanchev
Copy link
Contributor

Yes we could check if the payload is already an instance of the target class and skip the conversion.

@rstoyanchev rstoyanchev added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 8, 2019
@rstoyanchev rstoyanchev added this to the 5.2 M1 milestone Feb 8, 2019
@rstoyanchev rstoyanchev self-assigned this Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants