- Notifications
You must be signed in to change notification settings - Fork142
Rust client for Apache Kafka
License
kafka-rust/kafka-rust
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- This library is primarily documented through examples in itsAPIdocumentation.
- Documentation about Kafka itself can be found atits projecthome page.
This crate works with Cargo and is oncrates.io. The API is currentlyunder heavy movement although we do follow semantic versioning (butexpect the version number to grow quickly.)
[dependencies]kafka ="0.3"
To build kafka-rust you'll needlibsnappy-dev
on your local machine.If that library is not installed in the usual path, you can export theLD_LIBRARY_PATH
andLD_RUN_PATH
environment variables beforeissueingcargo build
.
Alternatively, support for various features, including snappy, can beturned off at compile time. See kafka-rust'sCargo.toml
andcargo's documentation.
kafka-rust
is tested against Kafka 0.8.2.x and regularly usedagainst Kafka 0.9 servers. However, efforts to implement support fornew features from the Kafka 0.9 release are just in their beginnings.
As mentioned, thecargo generateddocumentation constains someexamples. Further, standalone, compilable example programs areprovided in theexamples directory of therepository.
This is a higher-level Consumer API for Kafka. It provides convenientoffset management support on behalf of a specified group. This is theAPI a client application of this library wants to use for receivingmessages from Kafka.
This is a higher-level Producer API for Kafka. It provides convenientautomatic partition assignment capabilities through partitioners.This is the API a client application of this library wants to use forsending messsages to Kafka.
[KafkaClient] (http://spicavigo.github.io/kafka-rust/kafka/client/index.html)
KafkaClientis the central point of this API. However, this is a mid-levelabstraction for Kafka rather suitable for building higher-level APIs.Application's typically want to use the already mentionedConsumer
sandProducer
s. Nevertheless,KafkaClient
's main methods are:
- Loading metadata
- Fetching topic offsets
- Sending messages
- Fetching messages
- Committing a consumer group's offsets
- Fetching a consumer group's offsets
There's still a lot of room for improvements onkafka-rust
. Noteverything works right at the moment. Have a look into theissuetracker and feel freeto contribute by reporting new problems or contributing to existingones. Any constructive contribution is warmly wellcome!
As usually with open source, don't hesitate to fork the repo andsubmit a pull requests if you see something to be changed. We'll behappy seekafka-rust
improving over time.
[Creating a topic] (https://kafka.apache.org/08/quickstart.html)
Note unless otherwise explicitely stated in the documentation, thislibrary will ignore requests to topics which it doesn't know about.In particular it will not try to retrieve messages fromnon-existing/unknown topics. (This behavior is very likely to changein future version of this library.)
Given a local kafka server installation you can create topics if thefollowing command (kafka-topics.sh
is part of the Kafkadistribution):
kafka-topics.sh --topic my-topic --create --zookeeper localhost:2181 --partition 1 --replication-factor 1
About
Rust client for Apache Kafka
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.