SubscribeStrategy¶
SubscribeStrategy
is a ConsumerStrategy that is used for subscribe option.
SubscribeStrategy
uses KafkaConsumer.subscribe to subscribe a KafkaConsumer to the given topics.
Creating Instance¶
SubscribeStrategy
takes the following to be created:
- Topic Names
SubscribeStrategy
is created when:
KafkaSourceProvider
is requested for a consumer strategy (for subscribe option)
Creating Kafka Consumer¶
createConsumer(
kafkaParams: ju.Map[String, Object]): Consumer[Array[Byte], Array[Byte]]
createConsumer
is part of the ConsumerStrategy abstraction.
createConsumer
creates a KafkaConsumer
(Apache Kafka) to subscribe (using KafkaConsumer.subscribe) to the given topics.
Assigned TopicPartitions¶
assignedTopicPartitions(
admin: Admin): Set[TopicPartition]
assignedTopicPartitions
is part of the ConsumerStrategy abstraction.
assignedTopicPartitions
retrieveAllPartitions.
String Representation¶
toString(): String
toString
is part of the Object
(Java) abstraction.
toString
is the following (with the comma-separated topic names):
Subscribe[[topics]]
toString
is used (among the other uses) when:
KafkaOffsetReaderConsumer
is requested for the string representation (for KafkaMicroBatchStream)