Description Usage Arguments Details Value Note Author(s) References Examples
This function reads messages received by a KAFKA consumer. It fetches one message at a time
1 | rkafka.read(ConsumerObj)
|
ConsumerObj |
Consumer through which messages are to be read Required:Mandatory Type:Consumer |
This function returns one message at a time from the topic to which the consumer is associated. If no new message is found with 'x' time(set by ConsumerTimeoutMs property), then it returns ""
String
Warning: Ensure to close the consumer after reading messages. Won't work correctly next time otherwise
Shruti Gupta
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
To know how to use a high level consumer refer this: https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example
1 2 3 4 5 | ## Not run:
consumer1=rkafka.createConsumer("127.0.0.1:2181","test123")
print(rkafka.read(consumer1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.