From confluent-kafka-dotnet, ConsumeResult<T1, T2> Consume(CancellationToken ct)
method will:
Poll for new messages/events. Blocks
until a consume result is available or the
operation has been cancelled.
This means calling Consume()
will never really stop trying to consume messages from the partition (unless something crashes or you cancel the op). So if you have two events in a partition, the third call on Consume()
will just block until a new message is written to the partition.
Under the hood during the Consume
method, Kafka client keeps making calls to the broker to check whether new events are written to the partition.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…