from_offsets = {}
for i in range(11):
from_offsets[
TopicAndPartition(self.topic_name, i)
] = int(0)#指定偏移量
kafkaStreams = KafkaUtils.createDirectStream(ssc, [self.topic_name], fromOffsets=from_offsets, kafkaParams=kafkaParams)
pyspark streaming +Kafka 多个partition指定偏移量消费
最新推荐文章于 2022-12-28 16:54:28 发布