Last data update: 2014.03.03

R: Using Apache 'Kafka' Messaging Queue Through 'R'
rkafkaR Documentation

Using Apache 'Kafka' Messaging Queue Through 'R'

Description

It provides functionalities of creating a 'Kafka' producer, simple consumer,high level consumer and sending and receiving messages.

Details

Package: rkafka
Type: Package
Version: 1.0
Date: 2015-04-13
License: Apache License 2.0

1)Start 'Zookeeper' server. 2)Start 'Kafka' server. 3)Start producer using 'rkafka.createProducer' function. 4)Send messages using 'rkafka.send' function. 5)Close producer using 'rkafka.closeProducer' function. 6)Start consumer using 'rkafka.createConsumer' function. 7)Read messages using 'rkafka.read' function. 8)Close consumer using 'rkafka.closeConsumer' function.

Author(s)

Shruti Gupta

Maintainer: Who to complain to shruti.gupta@mu-sigma.com

References

To understand 'Kafka' kafka.apache.org/documentation.html

Examples

## Not run: 
prod1=rkafka.createProducer("127.0.0.1:9092")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing once")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing twice")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing thrice")
rkafka.closeProducer(prod1)
consumer1=rkafka.createConsumer("127.0.0.1:2181","test")
print(rkafka.read(consumer1))
print(rkafka.read(consumer1))
print(rkafka.read(consumer1))

## End(Not run)

Results