Zhengqi Zhang created FLINK-30434:
-------------------------------------

             Summary: The non-null check for transactionalIdPrefix is 
unnecessary in the KafkaWriter constructor
                 Key: FLINK-30434
                 URL: https://issues.apache.org/jira/browse/FLINK-30434
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Kafka
    Affects Versions: 1.15.3, 1.14.6, 1.16.0
            Reporter: Zhengqi Zhang
         Attachments: image-2022-12-16-18-24-14-706.png

The non-null check for transactionalIdPrefix is unnecessary in the KafkaWriter 
constructor, especially when EXACTLY_ONCE semantics are not used.
First, when EXACTLY_ONCE semantics are used, a non-null check has been 
performed for transactionalIdPrefix in KafkaSinkBuilder.
Secondly, although the default value "kafka-sink" has been assigned to 
transactionalIdPrefix in KafkaSinkBuilder, if the user uses the 
setTransactionalIdPrefix method to set it to null, the construction method of 
KafkaWriter will throw an exception, even if the user does not use EXACTLY_ONCE 
semantics at this time.
Obviously, we should allow transactionalIdPrefix to be null when EXACTLY_ONCE 
semantics are not used.

!image-2022-12-16-18-24-14-706.png|width=692,height=461!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to