wolfstudy opened a new issue #623:
URL: https://github.com/apache/pulsar-client-go/issues/623


   #### Expected behavior
   
   When topic is deleted forced, under normal circumstances, we should force 
the producer to be deleted. What the client feels is that the producer has been 
closed, instead of triggering the logic of reconnection.
   
   #### Actual behavior
   
   When topic is deleted forced, the request triggers the logic of reconnection.
   
   #### Steps to reproduce
   
   1. Start standalone (e.g: 2.8.0) and set `allowAutoTopicCreation=false` in 
`standalone.conf`
   2. Run the demo of producer:
   
   ```
   func main() {
        client, err := pulsar.NewClient(pulsar.ClientOptions{
                URL: "pulsar://localhost:6650",
        })
   
        if err != nil {
                log.Fatal(err)
        }
   
        defer client.Close()
   
        producer, err := client.CreateProducer(pulsar.ProducerOptions{
                Topic: "topic-1",
        })
        if err != nil {
                log.Fatal(err)
        }
   
        defer producer.Close()
   
        ctx := context.Background()
   
        for i := 0; i < 1000000; i++ {
                if msgId, err := producer.Send(ctx, &pulsar.ProducerMessage{
                        Payload: []byte(fmt.Sprintf("hello-%d", i)),
                }); err != nil {
                        log.Fatal(err)
                } else {
                        time.Sleep(1 * time.Second)
                        log.Println("Published message: ", msgId)
                }
        }
   }
   ```
   3. Run the cmd to force delete `topic-1`
   
   ```
    bin/pulsar-admin topics delete topic-1 -f
   ```
   
   4. Observing the behavior of this producer, we will find that we have 
triggered the reconnection logic.
   
   
![image](https://user-images.githubusercontent.com/20965307/135022305-940b0e96-27a8-4b70-a540-929713995e2d.png)
   
   The same code logic, we can see the following error message in java, this is 
the behavior we expect:
   
   
![image](https://user-images.githubusercontent.com/20965307/135022516-1e2235b3-8e21-4f1a-b287-f874a931354e.png)
   
   
   #### System configuration
   **Pulsar version**: x.y
   


-- 
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