rakfa.receiveFromSimpleConsumer: KAKFA Simple Consumer receiving messages

Description Usage Arguments Details Value Note Author(s) References Examples

Description

This function allows the KAKFA Simple Consumer to receive messages from a particular topic. However, this doesn't display the messages. To read the messages, use the rkafka.readFromSimpleConsumer function.

Usage

1
2

Arguments

SimpleConsumerObj

Simple Consumer object through which messages are to be read Required:Mandatory Type:SimpleConsumer

topicName

Name of the topic from where to read messages Required:Mandatory Type:String

partition

Partition Number Required:Mandatory Type:String

Offset

Offset Number Required:Mandatory Type:String

msgReadSize

Size of the message to be read Required:Mandatory Type:String

Details

There are two types of KAFKA consumers:High-Level and Simple. This function receives messages using the Simple Consumer. Use caution on deciding to use the Simple Consumer as it doesn't persist offset.This function needs to be run before executing the rkafka.readFromSimpleConsumer function

Value

Nothing

Note

Warning: Ensure to close the consumer after reading messages. Won't work correctly next time otherwise

Author(s)

Shruti Gupta

References

To know when to use simple consumer and when to use High-level Consumer, refer the url below: https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example

Examples

1
2
3
4
5
## Not run: 
consumer1=rkafka.createSimpleConsumer("172.25.1.78","9092","10000","100000","test")
rkafka.receiveFromSimpleConsumer(consumer1,"test","0","0","test-group")

## End(Not run)

shrutigupta23/rkafka documentation built on May 29, 2019, 9:36 a.m.