Added Support and Handling For Generic Headers#931
Merged
shrinandthakkar merged 3 commits intolinkedin:masterfrom Apr 12, 2023
Merged
Added Support and Handling For Generic Headers#931shrinandthakkar merged 3 commits intolinkedin:masterfrom
shrinandthakkar merged 3 commits intolinkedin:masterfrom
Conversation
jzakaryan
requested changes
Apr 11, 2023
| if (event instanceof BrooklinEnvelope) { | ||
| BrooklinEnvelope envelope = (BrooklinEnvelope) event; | ||
| headers = envelope.getHeaders(); | ||
| headers = envelope.getHeaders() instanceof Headers ? (Headers) envelope.getHeaders() : null; |
Collaborator
There was a problem hiding this comment.
Do we expect a non Kafka Headers object here? If no, is it worth throwing an exception or logging an error here?
Collaborator
Author
There was a problem hiding this comment.
logging would be costly as it would do it for every record, I instead added an exception path which will resist in moving further if something other than kafka type is encountered.
datastream-common/src/main/java/com/linkedin/datastream/common/BrooklinEnvelope.java
Show resolved
Hide resolved
35c47ed to
cd62178
Compare
cd62178 to
0a40645
Compare
ehoner
reviewed
Apr 11, 2023
datastream-common/src/main/java/com/linkedin/datastream/common/BrooklinEnvelope.java
Show resolved
Hide resolved
8dc2a67 to
31009f4
Compare
ehoner
approved these changes
Apr 11, 2023
jzakaryan
approved these changes
Apr 12, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BrooklinEnvelope supports transporting the source header data to the destination, but is currently bounded to Kafka's header type. This change replaces that with generic header to let any other publisher-subscriber transfer events & headers via brooklin.
Testing
Added a unit test comparing the source and destination event's headers.