feat: allow null and empty headers configuration option#865
Open
Nick Sia (itsnicksia) wants to merge 8 commits into
Open
feat: allow null and empty headers configuration option#865Nick Sia (itsnicksia) wants to merge 8 commits into
Nick Sia (itsnicksia) wants to merge 8 commits into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
Nick Sia (itsnicksia)
marked this pull request as ready for review
August 7, 2025 12:11
Nick Sia (itsnicksia)
marked this pull request as draft
August 7, 2025 12:12
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new configuration option to allow the S3 Sink Connector to process messages with null or empty headers when header writing is enabled. Previously, the connector would throw an error when encountering messages without headers even if header writing was configured.
- Adds
allow.null.and.empty.headersconfiguration option with default valuefalse - Modifies header validation logic to skip the error when the new option is enabled
- Includes unit test to verify the new behavior works correctly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| S3SinkConnectorConfig.java | Adds new configuration option definition and accessor method |
| KeyValueHeaderRecordWriterProvider.java | Updates header validation logic to check the new configuration |
| S3SinkTaskTest.java | Adds unit test for the new null/empty headers functionality |
Nick Sia (itsnicksia)
marked this pull request as ready for review
August 7, 2025 12:25
Nick Sia (itsnicksia)
marked this pull request as draft
August 7, 2025 12:30
Nick Sia (itsnicksia)
marked this pull request as ready for review
August 11, 2025 07:54
|
Subhash Iyer (@subhashiyer9) Sorry to bother - any chance I could get some feedback on this change please? |
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.
Problem
S3 Sink Connector will throw an error when processing a message with missing/empty headers when write headers is enabled.
In certain cases, users may wish to process topics that have a mix of messages with and without headers, and to save the headers where they exist.
For example:
#602
Solution
Provide a configuration option to allowmessages with missing headers, even when write headers is enabled.
The expected behaviour is that the connector will simply not write the header if it is empty or missing.
The default behaviour state of the setting will be
false, to maintain current behaviour of throwing an exception.Does this solution apply anywhere else?
Test Strategy
Manual testing on developer device.
Testing done:
Release Plan