Skip to content

Support Dynamic Topic Subscriptions Using Patterns in brod #617

@jasontleo

Description

@jasontleo

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. 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions