[
https://issues.apache.org/jira/browse/KAFKA-3539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921598#comment-16921598
]
alex gabriel commented on KAFKA-3539:
-------------------------------------
[[email protected]] [~stevenz3wu]
I think that you can avoid additional ExecutorService creation to make #send
fully non-blocking by specifying max.block.ms to 0.
But you still need to catch delivery exception until metadata comes.
In your current solutions(if I got it right) you still have the chance to lose
all the events that were allocated inside your ExecutorService queue( that is
not persistent) since you only add events to the persistence storage only after
rejection exceptions.
> KafkaProducer.send() may block even though it returns the Future
> ----------------------------------------------------------------
>
> Key: KAFKA-3539
> URL: https://issues.apache.org/jira/browse/KAFKA-3539
> Project: Kafka
> Issue Type: Bug
> Components: producer
> Reporter: Oleg Zhurakousky
> Priority: Critical
> Labels: needs-discussion, needs-kip
>
> You can get more details from the [email protected] by searching on the
> thread with the subject "KafkaProducer block on send".
> The bottom line is that method that returns Future must never block, since it
> essentially violates the Future contract as it was specifically designed to
> return immediately passing control back to the user to check for completion,
> cancel etc.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)