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

GH-3734: Support MessageHistory on Kafka deser #3753

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

artembilan
Copy link
Member

Fixes #3734

The MessageHistory is not in the trusted packages of the DefaultKafkaHeaderMapper
therefore it fails when MessageHistory.read() is performed.

  • Configure default DefaultKafkaHeaderMapper in the SubscribableKafkaChannel,
    KafkaInboundGateway, KafkaMessageDrivenChannelAdapter and KafkaMessageSource
    to also trust packages exposed via JacksonJsonUtils.DEFAULT_TRUSTED_PACKAGES
    which include a MessageHistory, too.

  • Verify in some integration Kafka tests to be sure that MessageHistory is
    deserialized properly in the transferred headers

  • Rework some tests to use @EmbeddedKafka instead of @BeforeAll/@AfterAll

Cherry-pick to 5.5.x

Fixes spring-projects#3734

The `MessageHistory` is not in the trusted packages of the `DefaultKafkaHeaderMapper`
therefore it fails when `MessageHistory.read()` is performed.

* Configure default `DefaultKafkaHeaderMapper` in the `SubscribableKafkaChannel`,
`KafkaInboundGateway`, `KafkaMessageDrivenChannelAdapter` and `KafkaMessageSource`
to also trust packages exposed via `JacksonJsonUtils.DEFAULT_TRUSTED_PACKAGES`
which include a `MessageHistory`, too.

* Verify in some integration Kafka tests to be sure that `MessageHistory` is
deserialized properly in the transferred headers
* Rework some tests to use `@EmbeddedKafka` instead of `@BeforeAll/@AfterAll`

**Cherry-pick to `5.5.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 comment/question

@garyrussell garyrussell merged commit d5501d8 into spring-projects:main Mar 22, 2022
@garyrussell
Copy link
Contributor

...cherry-picked as eec3e95 after resolving conflicts.

@pmahony893
Copy link

Changing Arrays.asList to List.of breaks this for Java 8, which is listed as a compatible version in the docs.

@artembilan
Copy link
Member Author

It has been fixed in the #3761. Will be released in a couple weeks - April 19th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default addition of "org.springframework.integration.history" to trusted packages of DefaultKafkaHeaderMapper
3 participants