aio-libs / aio-libs/aiokafka

Why ConsumerRebalanceListener is not expose when create a Consumer?

未關閉
#842 0 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
Python
星號
1.4k
分支
269
平均合併
1 天 1 小時
30 天內合併 PR
6

描述

Hi,

Thanks for the work that you are doing!!

According to the code, the only way to use the `ConsumerRebalanceListener` is using the `subscribe` method, I was wondering: Why is not also possible to set a `ConsumerRebalanceListener` when a `Consumer` is created using the `__init__`? I think if we do this, the testing will become easier because of mocking and you won’t be force to use the `subscribe` method.

In the `init` method is used
`self._subscription.subscribe(…)` which accepts a `ConsumerRebalanceListener` argument, so I think it is possible to make it.

Ideally, I think both options should be possible. If the user set a new `ConsumerRebalanceListenter` using the `subscribe` method, it should prevail.

what do you think?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。