KafkaConsumer: Creates KafkaConsumer object (R6 class)

Description Usage Format Usage Methods Arguments

Description

Creates KafkaConsumer object (R6 class)

Usage

1

Format

An object of class R6ClassGenerator of length 24.

Usage

For usage details see Methods, Arguments and Examples sections.

1
consumer$poll(interval = 100)

Methods

consumer = KafkaConsumer$new(topic_name, bootstrap_servers, group_id, config = list())
consumer$poll(interval = 100)

Fetch data for the topics or partitions specified using one of the subscribe/assign APIs. On each poll, consumer will try to use the last consumed offset as the starting offset and fetch sequentially. The last consumed offset can be manually set through #seek(TopicPartition, long) or automatically set as the last committed offset for the subscribed list of partitions

Arguments

consumer

A KafkaConsumer object

topic

name of a Kafka topic to read messages from

broker_list

bootstrap_servers for a Kafka cluster

config

ConsumerConfig parameters (in key = value format) for kafka client - see them here https://kafka.apache.org/0100/javadoc/index.html?org/apache/kafka/clients/consumer/ConsumerConfig.html

group_id

group_id for a Kafka client - will be used to understand offsets

interval

integer >= 0 scalar value. The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the buffer, else returns empty.


dselivanov/rscalaKafka documentation built on May 15, 2019, 2:59 p.m.