[
https://issues.apache.org/jira/browse/KAFKA-9882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17088888#comment-17088888
]
Boyang Chen commented on KAFKA-9882:
------------------------------------
I checked back on the original KIPĀ
[https://cwiki.apache.org/confluence/display/KAFKA/KIP-266%3A+Fix+consumer+indefinite+blocking+behavior]
So it seems the original intention was to resolve the indefinite blocking. For
your case, have you considered using
`public void subscribe(Pattern pattern, ConsumerRebalanceListener listener)`
which can plug in a user-callback to wait for assignment result?
> Add Block getAssignments()
> --------------------------
>
> Key: KAFKA-9882
> URL: https://issues.apache.org/jira/browse/KAFKA-9882
> Project: Kafka
> Issue Type: New Feature
> Components: clients
> Affects Versions: 2.5.0
> Reporter: Jesse Anderson
> Priority: Critical
>
> In 2.0, the KafkaConsumer poll(long) was deprecated and replaced with a
> poll(Duration). The poll(Duration) does not block for consumer assignments.
> Now, there isn't a blocking method that can get consumer assignments.
> A new KafkaConsumer method needs to be added that blocks while getting
> consumer assignments.
> The current workaround is to poll for a short amount of time in a while loop
> and check the size of assignment(). This isn't a great method of verifying
> the consumer assignment.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)