confluentinc/confluent-kafka-python

When consumer is paused check if it's paused

开放

#1,793 创建于 2024年8月8日

 (2 条评论) (1 个反应) (0 位负责人)Python (909 个派生)batch import
enhancementgood first issuesize:smallstatus:help-wantedstatus:waiting-for-interest

仓库指标

星标
 (3,526 个星标)
PR 合并指标
 (平均合并 10天 2小时) (30 天内合并 27 个 PR)

描述

Description

Feature request. When pausing a consumer, it would be nice if there was a way to check if the consumer is paused. For example a consumer could be paused / resumed based on various conditions and the user may want to know the current state of the consumer. Currently the only way to do this would be to store the state externally in another variable.

How to reproduce

from confluent_kafka import Consumer

c = Consumer({...})
c.subscribe(topics)
c.pause(topic_partitions)
# how to check if the consumer is paused? 

Ideally the consumer would have a method like .is_consumer_paused() or a property .paused

贡献者指南