Skip to content

Added Support and Handling For Generic Headers#931

Merged
shrinandthakkar merged 3 commits intolinkedin:masterfrom
shrinandthakkar:supportGenericHeaders
Apr 12, 2023
Merged

Added Support and Handling For Generic Headers#931
shrinandthakkar merged 3 commits intolinkedin:masterfrom
shrinandthakkar:supportGenericHeaders

Conversation

@shrinandthakkar
Copy link
Copy Markdown
Collaborator

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.

if (event instanceof BrooklinEnvelope) {
BrooklinEnvelope envelope = (BrooklinEnvelope) event;
headers = envelope.getHeaders();
headers = envelope.getHeaders() instanceof Headers ? (Headers) envelope.getHeaders() : null;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we expect a non Kafka Headers object here? If no, is it worth throwing an exception or logging an error here?

Copy link
Copy Markdown
Collaborator Author

@shrinandthakkar shrinandthakkar Apr 11, 2023

Choose a reason for hiding this comment

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

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.

@jzakaryan jzakaryan self-requested a review April 12, 2023 16:47
@shrinandthakkar shrinandthakkar merged commit a00a29f into linkedin:master Apr 12, 2023
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.

3 participants