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

Add support for a custom Kafka topic prefix in Hono components #3680

Open
yasemindogan93 opened this issue Mar 18, 2025 · 4 comments
Open

Add support for a custom Kafka topic prefix in Hono components #3680

yasemindogan93 opened this issue Mar 18, 2025 · 4 comments
Labels
Feature Request A request for adding new functionality to Hono

Comments

@yasemindogan93
Copy link

yasemindogan93 commented Mar 18, 2025

Issue Description

We would like to introduce a configuration property for Hono-based components to prepend a custom prefix to Kafka topic names. Currently, Hono topics follow a fixed naming scheme (e.g. hono.event.<tenant>). In some environments (e.g. multi-tenant or multi-cluster deployments), it is desirable to have an additional prefix (such as myPrefix.hono.event.<tenant>).

We propose adding a configuration option (e.g. hono.kafka.topicPrefix) that can be set via Quarkus or environment variables. All components should then consistently apply this prefix when creating or subscribing to Kafka topics.

Key Points

  1. Add a new config property (e.g. hono.kafka.topicPrefix).
  2. Apply this property across components (adapter, command router, auth service, registry, etc.) so that all Kafka producers/consumers use the custom prefix.
  3. Maintain backwards compatibility: if no prefix is set, the existing naming (e.g. hono.telemetry.<tenant>) should remain.

Rationale

Allows running multiple Hono-based environments in the same Kafka cluster.
Simplifies isolation or naming consistency across teams or tenants.

@sophokles73
Copy link
Contributor

Can't you do the same by simply using a prefix in the tenant ID for grouping tenants?

@yasemindogan93
Copy link
Author

You can certainly prefix the tenant ID, but that effectively bakes “environment” or “deployment” details right into the tenant name. In many cases, the tenant ID is managed externally or needs to remain “clean” (e.g. it is referenced in device registries, authorization rules, IoT management tools, etc.). A dedicated configuration property for a global prefix keeps the environment-specific or cluster-specific detail separate from tenant identities and ensures that Hono’s components can uniformly apply the prefix without forcing every tenant ID to include it.

@sophokles73
Copy link
Contributor

Ok, I see your point. Are you going to create a corresponding PR?

@sophokles73 sophokles73 added the Feature Request A request for adding new functionality to Hono label Mar 19, 2025
@yasemindogan93
Copy link
Author

Thanks for following up! I've already created a fork and am currently working on a PR. Once I finish making the necessary changes and verifying everything works as expected, I'll open the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A request for adding new functionality to Hono
Projects
None yet
Development

No branches or pull requests

2 participants