Confluent 的 Kafka REST 代理与 Kafka 客户端 [英] Confluent's Kafka REST Proxy vs Kafka Client

查看:42
本文介绍了Confluent 的 Kafka REST 代理与 Kafka 客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇 Confluent 的 Kafka REST Proxy 和使用 kafka 官方客户端库实现的生产者/消费者的优缺点.我知道 Confluent 的 Kafka REST Proxy 用于管理任务和 kafka 客户端不支持的语言.

I am curious about the advantages and disadvantages of Confluent's Kafka REST Proxy and the producer/consumer implemented with the kafka official client library. i know that Confluent's Kafka REST Proxy is used for administrative tasks and for languages ​​not supported by the kafka client.

那么,kafka客户端有什么优势?

So, what are the advantages of the kafka client?

推荐答案

本地客户端的一个优势是通过直接 TCP 到代理的原始性能,而不是在 REST 代理中发生的往返 HTTP 序列化 + JVM 序列化.

One advantage of a native client would be raw performance via direct TCP to the brokers rather than round trip HTTP serialization + JVM serialization taking place within the REST Proxy.

上述的一个缺点可能是为您的所有客户端维护各种语言的安全策略;否则任何人都可以生产和消费任何人的其他主题.如果您没有多租户 Kafka 集群,也许这不是一个因素.与 REST 代理相比,只有一个 SSL 证书,但在主题上拥有 ACL 可能仍然是一个好主意.

A disadvantage with the above could be maintaining security policies for all your clients in various languages; otherwise anyone could produce and consume any one's other topics. If you don't have a multi-tenant Kafka cluster, maybe that's not a factor. Compared to the REST proxy, there's only one SSL cert, but having ACLs on topics might still be a good idea.

REST 代理的明显优势是任何 HTTP 客户端都有一个标准接口可以与之进行交易.除了代理本身支持的内容外,无需区分客户端中的 Kafka 版本或支持的 API.但是,随着时间的推移,随着客户端的开发,这将变得越来越不需要.

The obvious advantage of the REST proxy is that there's a standard interface for any HTTP client to transact with. There's no need to distinguish Kafka versions or supported APIs in clients besides what the proxy itself supports. Over time, though, this will become less and less needed as clients are being developed.

另外,你之前的问题有什么好处Kafka REST 代理 API?

这篇关于Confluent 的 Kafka REST 代理与 Kafka 客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆