Go Client | Strengths | Limitations |
Sarama | It is very active in the community and widely used. Questions raised in the community are answered and solved quickly. It performs well. As it is written in native Go, it supports async and high-concurrency operations. | It is moderately stable. It may experience unknown errors after the number of partitions is increased and all partitions are rebalanced. |
Confluent-Kafka-go (recommended) | It is very stable. As it actually provides a layer of encapsulation for librdkafka, and librdkafka has been running for many years in multiple languages, it can be reliable enough. It performs well. As it is implemented in C++ at the underlying layer, it requires fewer resources and computes faster. | As it imports a C++ library, the Go compiler needs additional compilation configurations, which add compilation dependencies and make compilation more complex. In addition, as the logic for C++ library implementation varies by compilation environment, importing the `librdkafka` library may affect the cross-compilation of Go projects. |
kafka-go | It provides top-level APIs and exposes underlying APIs, which can be called more flexibly to configure the Kafka client. It is easy to use since it requires less code to produce and consume messages and has many default configuration items. | It underperforms the above two clients and may be unable to sustain a high concurrency. |
Was this page helpful?