[ 
https://issues.apache.org/jira/browse/FLINK-26379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499053#comment-17499053
 ] 

Ragu Krishnamurthy edited comment on FLINK-26379 at 2/28/22, 6:10 PM:
----------------------------------------------------------------------

Thank you [~MartijnVisser]!   will check KafkaSink.

 

Though I dont see partition fetch in new FlinkSink API, Have observed 
kafka-clients-2.4.1 is still being used. 

Any reason it is not upgraded to latest?


was (Author: JIRAUSER285826):
Thank you [~MartijnVisser]!   will check KafkaSink

> First message produced via Flink Kafka Connector is slow
> --------------------------------------------------------
>
>                 Key: FLINK-26379
>                 URL: https://issues.apache.org/jira/browse/FLINK-26379
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / Kafka
>    Affects Versions: 1.14.3
>            Reporter: Ragu Krishnamurthy
>            Priority: Major
>
> Topic partition map is initialized when the first message is processed rather 
> then constructor
>  
> *Code at constructor*
> [https://github.com/apache/flink/blob/5c6a220cc5e63b3c308e394b9199fb7740c08539/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java#L740]
> {code:java}
>         this.topicPartitionsMap = new HashMap<>(); {code}
>  
> *Code at invoke method*
> [https://github.com/apache/flink/blob/5c6a220cc5e63b3c308e394b9199fb7740c08539/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java#L879]
> {code:java}
>  int[] partitions = topicPartitionsMap.get(targetTopic);            
> if (null == partitions) {                
>  partitions = getPartitionsByTopic(targetTopic, transaction.producer);        
>              topicPartitionsMap.put(targetTopic, partitions);            
> } {code}
> Can this behavior be changed?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to