Skip to content

gfZeng/RDKafka.jl

 
 

Repository files navigation

RDKafka

Julia wrapper for librdkafka.

Build

Currently this package builds only on Linux and requires git and make to be available in command line.

using Pkg
Pkg.clone("https://github.com/dfdx/RDKafka.jl")
Pkg.build("RDKafka")

Usage

Producer:

p = KafkaProducer("localhost:9092")
partition = 0
produce(p, "mytopic", partition, "message key", "message payload")

Consumer:

c = KafkaConsumer("localhost:9092", "my-consumer-group")
parlist = [("mytopic", 0), ("mytopic", 1), ("mytopic", 2)]
subscribe(c, parlist)
timeout_ms = 1000
for i=1:10
    msg = poll(String, String, c, timeout_ms)
    show(msg)
end

About

Wrapper for librdkafka

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 100.0%