[Enhancement] Validation of subscription names in the Pulsar broker
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Motivation
Currently, for resources like tenants, namespaces, topics the Pulsar broker will do some validation on the naming to ensure a certain format: https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/naming/NamedEntity.java
For subscription names however, there is no validation at all, possibly causing issues in downstream systems.
### Solution
Introduce a validation for subscription names, similar to what is already done with `NamedEntity`.
Because this might break things for users currently using such names, it should be optional first so users have time to make the necessary changes.
### Alternatives
_No response_
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reading pulsar-common/src/main/java/org/apache/pulsar/common/naming/NamedEntity.java to understand the existing naming validation. Trace where subscription names enter the Pulsar broker, then determine how validation can be introduced as an optional behavior; done means invalid subscription names are handled consistently without immediately breaking existing users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100