Skip to content

Populate a JsonHeaders.RESOLVABLE_TYPE on reply #3163

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

Merged

Conversation

artembilan
Copy link
Member

Fixes spring-projects/spring-integration-samples#277

In the AbstractAmqpOutboundEndpoint the JsonHeaders.RESOLVABLE_TYPE
from request message is copied to reply message making inconsistency downstream.
The JsonToObjectTransformer consults first a JsonHeaders.RESOLVABLE_TYPE
and deserialize payload to wrong type

  • Fix DefaultAmqpHeaderMapper to populate a JsonHeaders.RESOLVABLE_TYPE
    alongside with other JsonHeaders populated from the reply AMQP message.
    This way a JsonHeaders.RESOLVABLE_TYPE from request message won't have effect
  • To get access to classes, supply AbstractHeaderMapper with a bean factory ClassLoader
  • Introduce a couple utility methods into JsonHeaders for building a ResolvableType

Cherry-pick to 5.2.x

Fixes spring-projects/spring-integration-samples#277

In the `AbstractAmqpOutboundEndpoint` the `JsonHeaders.RESOLVABLE_TYPE`
from request message is copied to reply message making inconsistency downstream.
The `JsonToObjectTransformer` consults first a `JsonHeaders.RESOLVABLE_TYPE`
and deserialize payload to wrong type

* Fix `DefaultAmqpHeaderMapper` to populate a `JsonHeaders.RESOLVABLE_TYPE`
alongside with other `JsonHeaders` populated from the reply AMQP message.
This way a `JsonHeaders.RESOLVABLE_TYPE` from request message won't have effect
* To get access to classes, supply `AbstractHeaderMapper` with a bean factory `ClassLoader`
* Introduce a couple utility methods into `JsonHeaders` for building a `ResolvableType`

**Cherry-pick to 5.2.x**
Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit-pick.

@garyrussell garyrussell merged commit 2f4394d into spring-projects:master Jan 31, 2020
@garyrussell
Copy link
Contributor

Cherry-picked to 5.2.x as 75476bd

garyrussell pushed a commit that referenced this pull request Jan 31, 2020
* Populate a JsonHeaders.RESOLVABLE_TYPE on reply

Fixes spring-projects/spring-integration-samples#277

In the `AbstractAmqpOutboundEndpoint` the `JsonHeaders.RESOLVABLE_TYPE`
from request message is copied to reply message making inconsistency downstream.
The `JsonToObjectTransformer` consults first a `JsonHeaders.RESOLVABLE_TYPE`
and deserialize payload to wrong type

* Fix `DefaultAmqpHeaderMapper` to populate a `JsonHeaders.RESOLVABLE_TYPE`
alongside with other `JsonHeaders` populated from the reply AMQP message.
This way a `JsonHeaders.RESOLVABLE_TYPE` from request message won't have effect
* To get access to classes, supply `AbstractHeaderMapper` with a bean factory `ClassLoader`
* Introduce a couple utility methods into `JsonHeaders` for building a `ResolvableType`

**Cherry-pick to 5.2.x**

* * Fix code formatting for arguments wrapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

amqp cafe application sample broken due to ClassCastException
2 participants