-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Feature Request: Add Support for stop
Method in Kafka Consumer
Description
The stop
method is currently not supported in the Confluent Kafka JavaScript client, as noted in the migration guide. The recommended workaround is to disconnect the consumer, but this approach has limitations in scenarios where pausing and resuming consumption is required without fully disconnecting.
Use Case
In our test suite, we need to:
- Consume all existing messages from a topic.
- Pause the consumer to produce new test messages.
- Resume the consumer to consume only the newly produced messages.
Using disconnect
as a workaround requires reinitializing the consumer and handling group rebalancing, which is both error-prone and inefficient. Similarly, pause
and resume
do not allow us to reconfigure the callback logic dynamically, as the run
method cannot be called again after the consumer is already running.
Proposed Solution
- Allows pausing message consumption without fully disconnecting the consumer.
- Supports re-executing the run method to dynamically adjust the callback logic or reset the consumer's state.
Additional Context
- Migration Guide
- Current workaround: Disconnecting and reconnecting the consumer.
- Using
pause
andresume
, which does not allow re-executing therun
method to adjust callback logic dynamically.
Thank you for considering this feature request!
Metadata
Metadata
Assignees
Labels
No labels