kafka sink claim check functionality supports only deliver raw value to the external storage #11396
Description
Is your feature request related to a problem?
TiCDC supports Kafka sink large message handle functionality since v7.4.0. There are two functionalities, the claim-check and the handle-key only.
If using the claim-check functionality, one Kafka message's key and value is encoded into JSON format, resulting in bytes, and then sent to the external storage systems.
For one kafka message, it has both key and value two parts, the key part is used to carry some metadata information to help the kafka producer and consumer handle the message. At the moment, TiCDC officially supports open-protocol, canal-json, avro, debezim and simple 5 encoding protocols, only the open-protocol set the key part.
We encode the key and value into JSON format, only makes the open-protocol generate only one object to carry all message information.
{
“key”: xxx,
“value”: xxxx,
}
There are some drawbacks:
- When using other protocols except open-protocol, the key part is always null.
- If any part is quit large, encoding phase may waste some CPU resource.
- If any part is quit large, the size of the result JSON bytes is larger than the size sum of the original key and value.
Describe the feature you'd like
We propose introducing one new changefeed level configuration, named claim-check-raw-value, to control whether encode key and value into JSON format or not.
[sink.kafka-config.large-message-handle]
large-message-handle-option = "claim-check"
claim-check-storage-uri = "xxx"
claim-check-raw-value = true # default to false
claim-check-raw-value is default to false, to make the default behavior compatible to previous version. After setting it to true, only deliver the value part to the external storage, the value is the result of protocol encoding:
- If using avro and simple protocol with avro encoding, it's avro format bytes.
- If using canal-json、debezium and simple protocol with json encoding, it's json format bytes.
xxxxxx # this is the value bytes, no other decorations
Describe alternatives you've considered
No response
Teachability, Documentation, Adoption, Migration Strategy
Add document to introduce this new configuration.