[ https://issues.apache.org/jira/browse/KAFKA-8809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17075890#comment-17075890 ]
Rens Groothuijsen commented on KAFKA-8809: ------------------------------------------ [~gsomogyi] I assume you're using the Java API? In that case, something like {{consumer.poll(Duration.ofMillis(timeout))}} should work. That did the trick for me, at least in the case of a failed SSL handshake. > Infinite retry if secure cluster tried to be reached from non-secure consumer > ----------------------------------------------------------------------------- > > Key: KAFKA-8809 > URL: https://issues.apache.org/jira/browse/KAFKA-8809 > Project: Kafka > Issue Type: Bug > Affects Versions: 2.3.0, 2.4.0 > Reporter: Gabor Somogyi > Priority: Critical > > Such case the following happening without throwing exception: > {code:java} > 19/08/15 04:10:44 INFO AppInfoParser: Kafka version: 2.3.0 > 19/08/15 04:10:44 INFO AppInfoParser: Kafka commitId: fc1aaa116b661c8a > 19/08/15 04:10:44 INFO AppInfoParser: Kafka startTimeMs: 1565867444977 > 19/08/15 04:10:44 INFO KafkaConsumer: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Subscribed to topic(s): topic-68f2c4c2-71a4-4380-a7c4-6fe0b9eea7ef > 19/08/15 04:10:44 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:45 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:45 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:45 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:45 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:46 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:46 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:46 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:46 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:46 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:46 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:47 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:47 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > 19/08/15 04:10:47 WARN NetworkClient: [Consumer clientId=consumer-1, > groupId=spark-kafka-source-8f333224-77d8-477c-a401-5bd0fce85d69--1266757633-driver-0] > Bootstrap broker 127.0.0.1:62995 (id: -1 rack: null) disconnected > 19/08/15 04:10:47 INFO Selector: [SocketServer brokerId=0] Failed > authentication with /127.0.0.1 (Unexpected Kafka request of type METADATA > during SASL handshake.) > {code} > I've tried to find a timeout or retry count but nothing helped. -- This message was sent by Atlassian Jira (v8.3.4#803005)