apache / apache/pulsar-client-go
[Reader] The topic not found when create reader with listener name
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
```
package main
import (
"context"
"fmt"
"log"
"github.com/apache/pulsar-client-go/pulsar"
)
func main() {
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: "pulsar://localhost:6000",
ListenerName: "custom:xxxx/vpc-xxxxxx/subnet-xxxxxx",
Authentication: pulsar.NewAuthenticationToken("eyJrZxxxxxxxxxxx"),
})
if err != nil {
log.Fatal(err)
}
defer client.Close()
reader, err := client.CreateReader(pulsar.ReaderOptions{
Topic: "persistent://test-tenant/test-ns/test-topic",
StartMessageID: pulsar.EarliestMessageID(),
})
if err != nil {
log.Fatal(err)
}
defer reader.Close()
for reader.HasNext() {
msg, err := reader.Next(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("Received message msgId: %#v -- content: '%s'\n",
msg.ID(), string(msg.Payload()))
}
}
```
**Expected behavior**
We can create the reader successfully
**Screenshots**

**Desktop (please complete the following information):**
- OS: Mac OS
- Go Version: master
---
But this topic already exists, it is normal to use producer or consumer
Contributor guide
Research direction
Start by reproducing the Go example with CreateReader, the custom ListenerName, and the existing persistent topic described in the issue. Trace the reader-creation path and compare it with producer or consumer creation; done means the reader is created successfully without reporting the existing topic as not found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100