[ 
https://issues.apache.org/jira/browse/KAFKA-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15753998#comment-15753998
 ] 

Marco Buccini edited comment on KAFKA-3468 at 12/16/16 10:20 AM:
-----------------------------------------------------------------

I bumped into the same issue yesterday, and I tried to figure out another way 
to deal with this problem. 

The main reason is that the producer is part of a more complex scenario, and 
whenever I try to stop the main application (e.g., with Ctrl+C), the producer 
will loop forever until I kill the application. However, this is something we 
would like to avoid. 

Is there a better way to deal with this issue? I have tried to use the producer 
in a synchronous way, so that whenever there is an exception, I close the 
producer and that should do the trick, but this also means that I would lose 
all the benefits of the asynchronous producer - and this also means that I have 
to re-open a producer every time I need it.



was (Author: makronized):
I bumped into the same issue yesterday, and I tried to figure out another way 
to deal with this problem. 

The main reason is that the producer is part of a more complex scenario, and 
whenever I try to stop the main application (e.g., with Ctrl+C), the producer 
will loop forever until I kill the application. However, this is something we 
would like to avoid. 

Is there a better way to deal with this issue? I have tried to use the producer 
in a synchronous way, so that whenever there is an exception, I close the 
producer and that should do the trick, but this also means that I would lose 
all the benefits of the asynchronous producer.


> Java clients never fail when bootstrap uses incorrect port
> ----------------------------------------------------------
>
>                 Key: KAFKA-3468
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3468
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Grant Henke
>
> When a client bootstrap uses a valid host but an incorrect port, the java 
> clients will never fail but instead loop forever trying to fetch metadata. A 
> sample debug log of the consumer is:
> {noformat}
> [2016-03-25 11:37:39,880] DEBUG Initialize connection to node -1 for sending 
> metadata request (org.apache.kafka.clients.NetworkClient:629)
> [2016-03-25 11:37:39,880] DEBUG Initiating connection to node -1 at 
> localhost:9999. (org.apache.kafka.clients.NetworkClient:492)
> [2016-03-25 11:37:39,881] DEBUG Node -1 disconnected. 
> (org.apache.kafka.clients.NetworkClient:459)
> [2016-03-25 11:37:39,881] DEBUG Give up sending metadata request since no 
> node is available (org.apache.kafka.clients.NetworkClient:614)
> [2016-03-25 11:37:39,983] DEBUG Initialize connection to node -1 for sending 
> metadata request (org.apache.kafka.clients.NetworkClient:629)
> [2016-03-25 11:37:39,983] DEBUG Initiating connection to node -1 at 
> localhost:9999. (org.apache.kafka.clients.NetworkClient:492)
> [2016-03-25 11:37:39,984] DEBUG Node -1 disconnected. 
> (org.apache.kafka.clients.NetworkClient:459)
> [2016-03-25 11:37:39,985] DEBUG Give up sending metadata request since no 
> node is available (org.apache.kafka.clients.NetworkClient:614)
> [2016-03-25 11:37:40,090] DEBUG Initialize connection to node -1 for sending 
> metadata request (org.apache.kafka.clients.NetworkClient:629)
> [2016-03-25 11:37:40,090] DEBUG Initiating connection to node -1 at 
> localhost:9999. (org.apache.kafka.clients.NetworkClient:492)
> [2016-03-25 11:37:40,091] DEBUG Node -1 disconnected. 
> (org.apache.kafka.clients.NetworkClient:459)
> [2016-03-25 11:37:40,091] DEBUG Give up sending metadata request since no 
> node is available (org.apache.kafka.clients.NetworkClient:614)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to