Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Dynamic Topic Subscriptions Using Patterns in brod #617

Open
jasontleo opened this issue Jan 29, 2025 · 1 comment
Open

Support Dynamic Topic Subscriptions Using Patterns in brod #617

jasontleo opened this issue Jan 29, 2025 · 1 comment

Comments

@jasontleo
Copy link

Description

Currently, the brod client requires explicit topic subscriptions at initialization, making it challenging to handle dynamic topic creation efficiently. This limitation is particularly problematic in multi-tenant environments and scenarios where topics are created and removed dynamically, such as for high-priority and low-priority messaging use cases.

A feature similar to Python’s kafka-python subscribe(pattern=...) would allow brod to automatically subscribe to topics matching a specified regular expression. This capability is crucial for handling use cases like:

  • Multi-Tenancy: Dynamically subscribing to tenant-specific topics without restarting consumers.
  • Priority-Based Processing: High-priority topics remain static, while low-priority topics (e.g., for backfills) are created on demand and removed when processing is complete.
  • Efficient Resource Utilization: Reducing active partitions and consumers for topics that are only needed intermittently.

References

Python Kafka Client supports this feature via subscribe(pattern="^low_priority_.*") (KafkaConsumer Docs).
Similar functionality exists in other Kafka client libraries, enabling more dynamic topic handling.
Would love to hear feedback from the maintainers on feasibility and potential roadmap for this feature. 🚀

@zmstone
Copy link
Contributor

zmstone commented Feb 4, 2025

Hi @jasontleo

Do you mean to support topic regex pattern for this config?

%% <li>`topics': Predefined set of topic names to join the
%% group. Mandatory
%%
%% NOTE: The group leader member will collect topics from all
%% members and assign all collected topic-partitions to members in
%% the group. i.e. members can join with arbitrary set of
%% topics.</li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants