flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fang Yong (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (FLINK-6366) KafkaConsumer is not closed in FlinkKafkaConsumer09
Date Mon, 24 Apr 2017 07:43:04 GMT

     [ https://issues.apache.org/jira/browse/FLINK-6366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Fang Yong reassigned FLINK-6366:
--------------------------------

    Assignee: Fang Yong

> KafkaConsumer is not closed in FlinkKafkaConsumer09
> ---------------------------------------------------
>
>                 Key: FLINK-6366
>                 URL: https://issues.apache.org/jira/browse/FLINK-6366
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Fang Yong
>            Assignee: Fang Yong
>
> In getKafkaPartitions of FlinkKafkaConsumer09, the KafkaConsumer is created as flowers
and will not be closed.
> {code:title=FlinkKafkaConsumer09.java|borderStyle=solid}
> protected List<KafkaTopicPartition> getKafkaPartitions(List<String> topics)
{
>     // read the partitions that belong to the listed topics
>     final List<KafkaTopicPartition> partitions = new ArrayList<>();
>     try (KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<>(this.properties))
{
>         for (final String topic: topics) {
>             // get partitions for each topic
>             List<PartitionInfo> partitionsForTopic = consumer.partitionsFor(topic);
>             ...
>         }
>     }
>     ...
> }
> {code}



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

Mime
View raw message