apache / apache/pulsar

[Bug] Pattern matching(Two Level Hierarchy) with consumer getting error while topic creation for the first time

Open
#23,201 1 comment 0 reactions 0 assignees View on GitHub
type/bug
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.

### Read release policy

- [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

### Version

Am working on Apache pulsar with latest version

Pattern matching listener : public/default/device-events/.*

Two level hierarchy ##
Working Topic : device-events/B101

Three level hierarchy ##
Not working Topic creation : device-events/B101/Command

Getting Error immediately in consumer :-

device-events/B101%2FCommand
Topic not found

Then after 10 seconds it's reloaded & for next request it's working

### Minimal reproduce step

Consumer needs to listen like below

Pattern matching listener : public/default/device-events/.*

Producer should send to topic

Sample 1

Topic creation : device-events/B101/Command

Sample 2

Topic creation : device-events/B102/Command

### What did you expect to see?

New Topic should be created & it's should listen by consumer

### What did you see instead?

"usekeyStoreTls": false, "sslProvider": null, "tlsKeyStoreType": "JKS", "tlsKeyStorePath": null, "tlsKeyStorePassword": null, "tls TrustStoreType": "JKS",

"tlsTrust StorePath": null, "tlsTrustStorePassword":null,"tlsCiphers":[],"tlsProtocols":[],"memoryLimitBytes":67188864, "proxyServiceUrl":null,

"proxyProtocol": null, "enableTransaction": false, "dnsLookupBindAddress":null, "dnsLookupBindPort": 6, "dnsServerAddresses":[],"socks5ProxyAddress":null,

"socks5ProxyUsername": null, "socks5ProxyPassword": null, "description":null,"openTelemetry":null}

2024-88-16715:59:53.801+05:30". INFO [..] 3578 [client-10-102-3] o.a.pulsar.client.impl.Consumecimal :

persistent://public/default/deyice-events/8181%2FWIFI] [serversub] Subscribing to topic on cnx [id: Oxfced1944, L:/127.0.0.1:50044 R:localhost/127. [

1:6650], consumerId 1

2824-08-16T15:59:53.806+05:30 WARN []" 3578 [client-io-102-3] o.apache.pulsar.client.impl.Clientenx : [id: 0xfced1944, L:/127.0.0.1:50044 -

R:Localhost/127.8.0.1:6658] Received error from server: Topic persistent://public/default/device-events/8181%2FWIFI does not exist

2024-88-16T15:59:53.806+05:30 " WARN [,] " 3578 [client-io-102-3) o.a.pulsar.client.impl.Consumerimal :

[persistent://public/default/device-events/8101%2FWIFI] [serversub] Failed to subscribe to topic on localhost/127.0.0.1:6650

2024-08-16T15:59:53.886+05:30 WARN [,,]" 3578 [client-io-182-3] o.a.p.c.impl.MultiTopics Consumerληρ : [MultiTopicsConsumer-dice] Failed to

subscribe for topic (persistent://public/default/device-events/8101%2FWIFI) in topics consumer org.apache.pulsar.client.api

-PulsarClientException$TopicDoesNotExistException: ("errorMsg": "Topic persistent://public/default/device-events/8101%2FWIFI does not exist",

regid":3198925238307829658, "remote": "localhost/127.0.0.1:6650", "local":"/127.0.0.1:50044"}

" INFO [..]" 3578---[-listener-107-1] o.a.pulsar.client.impl.consumerthel

2024-08-16T15:59:53.807+05:30 ] [serversub] Closed Consumer (not connected)

[persistent://public/default/device-events/8101%2FWIFI 2824-88-26T15:59:53.807+05:30 WARN [,,]" 3578 [-internal-121-1] o.a.p.c.impl.MultiTopics.ConsumerImpl : [MultiTopicsConsumer-dice] Failed to

subscribe for topic [persistent://public/default/device-events/8101%2FWIFI) in topics consumer, subscribe error: org.apache.pulsar.client.api

PulsarClientException&TopicDoesNotExistException: ("errorMsg": "Topic persistent://public/default/device-events/8101%2FWIFI does not exist",

"reqId":3198925238307829658, "remote" : "localhost/127.0.0.1:6650", "local":"/127.0.0.1:50044"}

2024-08-16T15:59:53.808+05:30 " WARN [,,]" 3578 --- [-internal-121-1] o.a.p.c.i.PatternMultiTopicsConsumerima): [MultiTopicsConsumer-dice] Failed to

subscribe to topics: org.apache.pulsar.client.api.PulsarClientExceptions.TopicDoesNotExistException: {"errorisg": "Topic persistent://public/default/device-events/8101%2FWIFI does not exist", "reqId":3198925238307829658, "remote": "localhost/127.0.0.1:6658", "Local":"/127.0

1:58844

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the pattern listener with public/default/device-events/.* and topics such as device-events/B101/Command, comparing two-level and three-level topic creation. Read the PatternMultiTopicsConsumer and MultiTopicsConsumer error path around TopicDoesNotExistException and the delayed reload. Done means newly created matching topics are subscribed to without the initial failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.