[
https://issues.apache.org/jira/browse/KAFKA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965646#comment-14965646
]
ASF GitHub Bot commented on KAFKA-2657:
---------------------------------------
GitHub user apakulov opened a pull request:
https://github.com/apache/kafka/pull/336
KAFKA-2657; Kafka clients fail to start if one of broker isn't resolved by
DNS
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apakulov/kafka KAFKA-2657
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/336.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #336
----
commit d1a54ed3d9d13ce640a521ca21b2141e7c1c9ab1
Author: Alexander Pakulov <[email protected]>
Date: 2015-10-20T19:43:22Z
KAFKA-2657; Kafka clients fail to start if one of broker isn't resolved by
DNS
----
> Kafka clients fail to start if one of broker isn't resolved by DNS
> -------------------------------------------------------------------
>
> Key: KAFKA-2657
> URL: https://issues.apache.org/jira/browse/KAFKA-2657
> Project: Kafka
> Issue Type: Bug
> Reporter: Alexander Pakulov
> Priority: Minor
>
> During org.apache.kafka.clients.producer.KafkaProducer and
> org.apache.kafka.clients.consumer.KafkaConsumer object creation constructors
> invoke org.apache.kafka.common.utils.ClientUtils#parseAndValidateAddresses
> which potentially could throw an exception if one the nodes hasn't been
> resolved by DNS. As a result of that - object hasn't been created and you
> aren't able to use Kafka clients.
> I personally think that Kafka should be able to operate with cluster with
> quorum number of instances.
> {code:java}
> try {
> InetSocketAddress address = new InetSocketAddress(host, port);
> if (address.isUnresolved())
> throw new ConfigException("DNS resolution failed for url in " +
> ProducerConfig.BOOTSTRAP_SERVERS_CONFIG + ": " + url);
> addresses.add(address);
> } catch (NumberFormatException e) {
> throw new ConfigException("Invalid port in " +
> ProducerConfig.BOOTSTRAP_SERVERS_CONFIG + ": " + url);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)