-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-3067: Draft of mapping multiple headers with same key #3101
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with the solution.
Please, consider to run gradlew check
locally, so you will see Checkstyle violations.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, also add your name to the @author
list of the affected classes.
The whats-new.adoc
deserves a new entry for this new feature.
And headers.adoc
must be improved about this new behavior.
I also see that you did nothing for the DefaultKafkaHeaderMapper
.
Probably the logic you have introduced can go into the AbstractKafkaHeaderMapper
?
Yes of course. This was just a starter to make sure I'm on the right track. |
@poznachowski, Any updates on this? We have a release coming up next week. If you want this to be part of that release, we need to start further review on this PR sooner. |
I should have something ready tomorrow. |
I updated my MR with initial version (not polished) of |
@poznachowski We moved the milestone to |
@sobychacko sure, should have it ready somewhere beginning next week. |
@poznachowski Any updates on this PR? |
ac22919
to
61552d0
Compare
I'd like to say that I have all ready, but I found some Spring specific header inconsistencies and struggling with picking the right approach.
Having said that I'd suggest to keep a list of Spring 'technical' Kafka headers that should never be mapped into a collection on the Spring side (only last values should be kept). This would avoid unnecessary changes in the code (especially in the retrytopic package). If this plus reversing list order (so |
@poznachowski Sorry for the delay in responding to you. The approach you mentioned for keeping the internal metadata type headers as only single-value item makes sense. As long as it doesn't bring any backward compatibility issues, it's ok to reverse the order. Please re-work the PR and when ready, remove the draft status, so that we can start a formal PR review. Thanks! |
@@ -97,6 +102,7 @@ public class DefaultKafkaHeaderMapper extends AbstractKafkaHeaderMapper { | |||
* {@code "!id", "!timestamp" and "*"}. In addition, most of the headers in | |||
* {@link KafkaHeaders} are never mapped as headers since they represent data in | |||
* consumer/producer records. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, consider to not reformat Javadocs: no empty lines for methods.
} | ||
jsonHeaders.put(headerIndex == null ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you are doing here, but I think all the framework headers must be as a single value Kafka headers anyway. There are a lot of logic in the framework which relies on them.
We just must agree that we have to make a fix only for end-user headers which can be iterable.
Even if that JSON headers looks like a collection, it is really something what the framework rely on as as single header.
So, I don't expect too drastic changes in this area.
Thanks.
@poznachowski Are you going to continue working on this PR? We can also consider taking it on our end and start making additional changes on top of your PR. Please let us know the status. |
@poznachowski, I just wanted to see if there is an update on this PR. If you are busy, we can take this PR and work on it on our end. Please let us know. Thank you. |
@sobychacko Sorry for lack of response. I was quite unavailable, but back now. If you allow I will try to finalize the MR next week the latest. |
@poznachowski, Any updates on this PR? We are still in the milestone stages of the |
…h SimpleKafkaHeaderMapper
Draft of mapping iterable headers