Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rust client for Apache Kafka

License

NotificationsYou must be signed in to change notification settings

kafka-rust/kafka-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Documentation

Installation

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.

Supported Kafka version

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.

Examples

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.

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 mentionedConsumersandProducers. Nevertheless,KafkaClient's main methods are:

Bugs / Features / Contributing

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.

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

Stars

Watchers

Forks

Packages

No packages published

Contributors22


[8]ページ先頭

©2009-2025 Movatter.jp