Kafka ssl Producer EOFException,同时来自Cloud Foundry的Producer.send

时间:2017-01-24 02:43:15

标签: ssl apache-kafka cloudfoundry eofexception producer

在Cloud Foundry中,我能够向非ssl url生成消息(" kafkaURL:9092")。但它不适用于ssl url(" kafkaURL:9093")。

Kafka服务器版本0.10.0.1和客户端版本0.10.0.0。

以下是我使用的属性

kafka-console-producer --broker-list kafkaURL:9093 --producer.config config  --topic myTopicName

在kafka服务器上的Kafka shell中使用相同的属性和相同的cert文件(truststore,keystore文件)时,可以使用shell中的以下命令正常工作:

2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT java.io.EOFException
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:99)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.network.BlockingChannel.readCompletely(BlockingChannel.scala:129)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.network.BlockingChannel.receive(BlockingChannel.scala:120)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:77)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:74)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.SyncProducer.send(SyncProducer.scala:119)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.BrokerPartitionInfo.updateInfo(BrokerPartitionInfo.scala:82)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.async.DefaultEventHandler$$anonfun$handle$1.apply$mcV$sp(DefaultEventHandler.scala:68)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:79)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.utils.Logging$class.swallowError(Logging.scala:106)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.utils.CoreUtils$.swallowError(CoreUtils.scala:51)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:68)
2017-01-18T12:03:29.78-0600 [APP/PROC/WEB/0]OUT     at kafka.producer.Producer.send(Producer.scala:77)

这是错误:

{{1}}

1 个答案:

答案 0 :(得分:0)

我们的Kafka客户端代码版本:“0.9.0.1”在服务器移动到0.10.0.1时停止工作 当我们将客户端代码更改为0.10.0.0时,我们仍然得到相同的EOFileException 当我们更换时,它得到修复 不推荐使用的类kafka.producer。{KeyedMessage,Producer,ProducerConfig} 使用新的0.10.0类org.apache.kafka.clients.producer。{ProducerRecord,KafkaProducer,ProducerConfig} 顺便说一下旧的弃用类在指向非SSL URL时工作正常,只有在指向安全Kafka URL时它们才会失败