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

reuse RecordHeader in AggregatingReplyingKafkaTemplate #2932

Conversation

NathanQingyangXu
Copy link
Contributor

It seems there is some logic cleaning up room in AggregatingReplyingKafkaTemplate to reuse existing RecordHeader without duplicating it.

Not very sure about the validity of my PR. Feel free to close it if invalid.

@NathanQingyangXu NathanQingyangXu force-pushed the reuse-correlation-header-in-aggregatingReplyingKafkaTemplate branch from 263cac8 to 7695889 Compare December 13, 2023 04:38
isBinaryCorrelation()
? ((CorrelationKey) correlationId).getCorrelationId()
: ((String) correlationId).getBytes(StandardCharsets.UTF_8)));
done.headers().add(correlation);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems regardless of whether binary format is used or not, we simply reuse the same header; also helps eliminate two casting warnings in IDE along the way.

@artembilan artembilan added this to the 3.1.1 milestone Dec 13, 2023
@artembilan artembilan merged commit 7259e5e into spring-projects:main Dec 13, 2023
2 checks passed
@artembilan
Copy link
Member

@NathanQingyangXu ,

Thank you for contribution; looking forward for more!

@NathanQingyangXu
Copy link
Contributor Author

NathanQingyangXu commented Dec 13, 2023 via email

@NathanQingyangXu NathanQingyangXu deleted the reuse-correlation-header-in-aggregatingReplyingKafkaTemplate branch December 13, 2023 23:43
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.

None yet

2 participants