к каталогу

📦 rust-rdkafka/ fede1024

A fully asynchronous, futures-based Kafka client library for Rust based on librdkafka

Открыть на GitHubобновлён 3нед назад
Звёзды
2.0k
Форки
355
За неделю
За месяц
Рост %
Язык
Rust

Установка и запуск

Installation

Add this to your Cargo.toml:

[dependencies]
rdkafka = { version = "0.25", features = ["cmake-build"] }

This crate will compile librdkafka from sources and link it statically to your executable. To compile librdkafka you'll need:

  • the GNU toolchain
  • GNU make
  • pthreads
  • libcurl-dev: e.g. libcurl4-openssl-dev on ubuntu
  • zlib: optional, but included by default (feature: libz)
  • cmake: optional, not included by default (feature: cmake-build)
  • libssl-dev: optional, not included by default (feature: ssl)
  • libsasl2-dev: optional, not included by default (feature: gssapi)
  • libzstd-dev: optional, not included by default (feature: zstd-pkg-config)

Note that using the CMake build system, via the cmake-build feature, is encouraged if you can take the dependency on CMake.

By default a submodule with the librdkafka sources pinned to a specific commit will be used to compile and statically link the library. The dynamic-linking feature can be used to instead dynamically link rdkafka to the system's version of librdkafka. Example:

[dependencies]
rdkafka = { version = "0.25", features = ["dynamic-linking"] }

If you'd like to compile librdkafka statically yourself, then use that, you can use static-linking while supplying DEP_LIBRDKAFKA_STATIC_ROOT with path to where librdkafka was built.

For a full listing of features, consult the [rdkafka-sys crate's documentation][rdkafka-sys-features]. All of rdkafka-sys features are re-exported as rdkafka features.

Из README репозитория · полный README на GitHub

Категории

Теги

futureskafkakafka-clientlibrdkafkarust