SubscribeStrategy is a ConsumerStrategy that is used for subscribe option.
SubscribeStrategy uses KafkaConsumer.subscribe to subscribe a KafkaConsumer to the given topics.
SubscribeStrategy takes the following to be created:
- Topic Names
SubscribeStrategy is created when:
KafkaSourceProvideris 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.
assignedTopicPartitions( admin: Admin): Set[TopicPartition]
assignedTopicPartitions is part of the ConsumerStrategy abstraction.
toString is part of the
Object (Java) abstraction.
toString is the following (with the comma-separated topic names):
toString is used (among the other uses) when:
KafkaOffsetReaderConsumeris requested for the string representation (for KafkaMicroBatchStream)