Skip to content

Repository files navigation

fRranz: An R Kafka Client

Lifecycle badge

THIS PROJECT IS STILL ALPHA CURRENTLY -- Check back often!!

What is fRanz

fRanz is an open source R kafka client that allows users to read and write messages from kafka. It leverages the stability and performance of librdkafka and implements ididiomatic R workflows ontop of it.

Example of sending and reading a message

library(fRanz)
BROKER_HOST<-'localhost'BROKER_PORT<-9092TOPIC_NAME<-'myTestTopic'# KafkaBrokerbroker<-KafkaBroker$new(host=BROKER_HOST, port=BROKER_PORT)
# KafkaProducerproducer<-KafkaProducer$new(brokers=list(broker))
producer$produce(topic=TOPIC_NAME,
key="myKey",
value="My First Message")
# Number of messages successfuly sent is returned# [1] 1 # KafkaConsumerconsumer<-KafkaConsumer$new(brokers=list(broker), groupId="test", extraOptions=list(`auto.offset.reset`="earliest"))
consumer$subscribe(topics= c(TOPIC_NAME))
result<-consumer$consume(topic=TOPIC_NAME)
result# Consumed messages are returned in a list(list(key,val)) format# [[1]]# [[1]]$key# [1] "myKey"## [[1]]$payload# [1] "My First Message" 

About

R client for Apache Kafka

Topics

Resources

Code of conduct

Contributing

Stars

19 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages