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

ASF GitHub Bot commented on FLINK-6288:
---------------------------------------

Github user fanyon commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3766#discussion_r114466534
  
    --- Diff: 
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBase.java
 ---
    @@ -281,6 +307,47 @@ public void onCompletion(RecordMetadata metadata, 
Exception exception) {
                }
        }
     
    +   protected int[] getPartitionsByTopic(String topic, 
KafkaProducer<byte[], byte[]> producer) {
    +           Future<int[]> future = executor.submit(new 
PartitionMetaTask(topic, producer));
    +
    +           try {
    +                   return future.get(kafkaMetaTimeoutMs, 
TimeUnit.MILLISECONDS);
    +           } catch (Exception e) {
    +                   throw new RuntimeException(e);
    --- End diff --
    
    Yes, retry here will be nicer, I'll fix it, thanks :)


> FlinkKafkaProducer's custom Partitioner is always invoked with number of 
> partitions of default topic
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-6288
>                 URL: https://issues.apache.org/jira/browse/FLINK-6288
>             Project: Flink
>          Issue Type: Improvement
>          Components: Kafka Connector
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Fang Yong
>
> The {{FlinkKafkaProducerBase}} supports routing records to topics besides the 
> default topic, but the custom {{Partitioner}} interface does not follow this 
> semantic.
> The partitioner is always invoked the {{partition}} method with the number of 
> partitions in the default topic, and not the number of partitions of the 
> current {{targetTopic}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to