Support dynamic table routing via kafka message header 'table.name.format' #1519
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
#960
#1208
#1194
Multiple table sink support has been requested in several issues.
Currently, JDBC sink connector only supports routing all records to a single table or using topic-based routing, which limits flexibility for complex data pipeline requirements.
Solution
This PR implements a simple and non-intrusive approach to support multiple table sinks by leveraging Kafka message headers.
I am currently operating a data pipeline in production using this feature, successfully routing data from a single Kafka topic through a single connector to over 100 different tables. This demonstrates the scalability and reliability of this approach for complex, multi-table data ingestion scenarios.
Key Implementation Details:
table.name.format
is set to__RECORD_HEADER__
, the connector activates header-based table routingtable.name.format
How it works:
table.name.format
=__RECORD_HEADER__
table.name.format
and target table name as valueDoes this solution apply anywhere else?
If yes, where?
Test Strategy
Testing done:
Release Plan