[FLINK-28842][Connector/Kafka] Add client.id.prefix for the KafkaSink
What is the purpose of the change
Adding a way to configure client.id.prefix for the KafkaSink, which, internally, configures client.id for the KafkaProducer. This implementation essentially copies the implementation of client.id.prefix in KafkaSource.
Brief change log
- Added a new
CLIENT_ID_PREFIXfor the KafkaSink - Added a way to configure it for the KafkaSink
- Updated KafkaWriter to use
CLIENT_ID_PREFIXwith the subtaskId to generate aclient.idfor the KafkaProducer - Also updated the documentation and added a test
Verifying this change
This change added a unit test and can be verified by running KafkaWriterITCase.
Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
@Public(Evolving): yes - The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? docs
CI report:
- 1b194a7e7df0fdc97850792c3d9820e9d82eadae Azure: FAILURE
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
@flinkbot run azure
@flinkbot run azure
@PatrickRen Any thoughts?
Thanks for the PR @sap1ens . As this is adding a new public API for Kafka sink, I think at least a discussion is required in the mailing list and we need vote for it. Do you mind starting a discussion thread in the dev and user mailing list?
@PatrickRen thanks for reminding me about that, I kicked off the discussion.
@sap1ens Do you want to move this PR to https://github.com/apache/flink-connector-kafka ?