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

Get not allowed error, Unable to create topic list watcher: Pattern longer than maximum: 50 #23750

Open
1 of 2 tasks
dmonopoly opened this issue Dec 17, 2024 · 1 comment
Open
1 of 2 tasks
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@dmonopoly
Copy link

dmonopoly commented Dec 17, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

I have topics that are very long: about 100 characters. The regex matcher cannot handle this apparently.

var patternStr = topic + ".*"
val topicPattern: Pattern = Pattern.compile(patternStr)
pulsarConsumer = consumerBuilder.topicsPattern(topicPattern).subscribe()

=> [pulsar-client-io-1-3] ERROR org.apache.pulsar.client.impl.ClientCnx - Get not allowed error, Unable to create topic list watcher: Pattern longer than maximum: 50

If I try to shorten the topic pattern and only use the last 50 or so characters, this is also not allowed:

var patternStr = topic + ".*"
if (topic.length > 46) {
    patternStr = ".*" + topic.slice(topic.length - 46..topic.length - 1) + ".*"
    logger.info("Using shortened topic regex matcher: $patternStr")
}
val topicPattern: Pattern = Pattern.compile(patternStr)
pulsarConsumer = consumerBuilder.topicsPattern(topicPattern).subscribe()

=>

    Exception in thread "main" org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid short topic name '.*place513/consumption-metamagic542153-coverage-v0.*', it should be in the format of <tenant>/<namespace>/<topic> or <topic>
	at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:1111)
	at org.apache.pulsar.client.impl.ConsumerBuilderImpl.subscribe(ConsumerBuilderImpl.java:103)

Solution

No response

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@dmonopoly dmonopoly added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Dec 17, 2024
@tsturzl
Copy link
Contributor

tsturzl commented Jan 9, 2025

I'm running into this, seems very strange to limit the pattern by string length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

2 participants