frederickdark commented on issue #1148:
URL: 
https://github.com/apache/pulsar-client-go/issues/1148#issuecomment-1927337901

   Thanks for your question!
   I'm facing the same situation with a consumer:
   
   ```
       client, err := pulsar.NewClient(pulsar.ClientOptions{
           URL: "pulsar://localhost:6650",
       })
       if err != nil {
           fmt.Println("Error creating the client:", err)
           return
       }
       defer client.Close()
   
       consumer, err := client.Subscribe(pulsar.ConsumerOptions{
           Topic:            "persistent://public/default/my-topic",
           SubscriptionName: "my-sub",
       })
       if err != nil {
           fmt.Println("Error creating the consumer:", err)
           return
       }
       defer consumer.Close()
   
       for {
           // From this point on, no matter what happens with the client's 
connection,
           // my consumer doesn't receive an error about it and keeps waiting 
for new messages
           msg, err := consumer.Receive(context.Background())
           if err != nil {
               fmt.Println("Error receiving the message:", err)
               break
           }
           fmt.Printf("Message received: %s\n", string(msg.Payload()))
           consumer.Ack(msg)
       }
   ```
   
   A'm I missing something?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to