[ https://issues.apache.org/jira/browse/KAFKA-1660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14154809#comment-14154809 ]
Andrew Stein commented on KAFKA-1660: ------------------------------------- Hi [~jkreps], I don't think that this (the request for {{producer.close(timeout)}}) and KAFKA-1659 (the request for {{producer.abort()}}) are the same. If {{producer.close(timeout)}} were to return without actually closing the producer in time, the user could then continue with {{producer.abort()}}. However, this would not be the only case where {{producer.abort()}} would be useful. It could be used if a {{producer.send()}} were to fail or if a {{future.get()}} were to fail as well. In addition if {{producer.close()}} were to return without actually closing the producer in time, the user could continue with other logic besides {{producer.abort()}}. > Ability to call close() with a timeout on the Java Kafka Producer. > ------------------------------------------------------------------- > > Key: KAFKA-1660 > URL: https://issues.apache.org/jira/browse/KAFKA-1660 > Project: Kafka > Issue Type: Improvement > Components: clients, producer > Affects Versions: 0.8.2 > Reporter: Andrew Stein > Assignee: Jun Rao > Fix For: 0.8.2 > > > I would like the ability to call {{close}} with a timeout on the Java > Client's KafkaProducer. > h6. Workaround > Currently, it is possible to ensure that {{close}} will return quickly by > first doing a {{future.get(timeout)}} on the last future produced on each > partition, but this means that the user has to define the partitions up front > at the time of {{send}} and track the returned {{future}}'s -- This message was sent by Atlassian JIRA (v6.3.4#6332)