简体   繁体   English

Apache Kafka Consumer - Java 客户端与其他客户端之间的代理主机解析

[英]Apache Kafka Consumer - Broker host resolution between Java Client vs. rest of the Clients

There is a scenario where I would be required to connect to external kafka and consume data for further processing.有一种情况需要我连接到外部 kafka 并使用数据进行进一步处理。 Is there a fundamental difference between kafka python client vs. Java clients in the way they are implemented? kafka python客户端与Java客户端在实现方式上是否存在根本区别?

Python Client with the same host connects to broker and consumes over TLS but both Kafka console consumer or any java based clients establishes connection to broker (successfuly does SSL Handshake) but further fails as the client is not able to connect and subscribe.具有相同主机的 Python 客户端连接到代理并通过 TLS 进行消费,但 Kafka 控制台消费者或任何基于 Java 的客户端都建立了与代理的连接(成功进行 SSL 握手)但由于客户端无法连接和订阅而进一步失败。

I am aware of listeners and advertised listeners, but python kafka is able to establish connection to broker and consume fine which confuses me.我知道侦听器和广告侦听器,但是 python kafka 能够建立与代理的连接并消耗得很好,这让我感到困惑。

Can anyone elaborate on how different the clients are from each other?谁能详细说明客户之间的不同之处?

The Kafka TCP protocol is the same for all clients. Kafka TCP 协议对所有客户端都是相同的。

Java, however, might require JKS files in addition to TLS certificates.但是,除了 TLS 证书之外,Java 可能还需要 JKS 文件。

Non Java clients cannot use JKS files, however.但是,非 Java 客户端不能使用 JKS 文件。 If you're using the Confluent Python client, then it'll use librdkafka, which is also implemented by kcat CLI, which you could also test with rather than builtin Kafka tools如果您使用的是 Confluent Python 客户端,那么它将使用 librdkafka,它也是由kcat CLI 实现的,您也可以使用而不是内置的 Kafka 工具进行测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM