You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/28 04:18:41 UTC

[GitHub] [pulsar-client-go] wolfstudy opened a new issue #623: When topic is deleted forced, don't to tigger reconnect logic

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #623: When topic is deleted forced, don't to tigger reconnect logic

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #623:
URL: https://github.com/apache/pulsar-client-go/issues/623#issuecomment-928768695


   And the java demo as follows:
   
   ```
   public static void main(String[] args) throws PulsarClientException {
           PulsarClient client = PulsarClient.builder()
                   .serviceUrl("pulsar://localhost:6650")
                   .build();
   
           final String topic = "test-topic-002";
           final int msgCount = 100000;
   
           Producer<byte[]> producer = client.newProducer()
                   .topic(topic)
                   .create();
           for (int i = 0; i < msgCount; i++) {
               String value = "new msg No." + i;
               MessageId msgId = producer.newMessage()
                       .value(value.getBytes())
                       .send();
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException exception) {
                   exception.printStackTrace();
               }
               System.out.println("===>>> produce msg id:" + new String(msgId.toString()) + ", value:" + value);
           }
           producer.flush();
   }
   ```


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] zymap closed issue #623: When topic is deleted forced, don't to tigger reconnect logic

Posted by GitBox <gi...@apache.org>.
zymap closed issue #623:
URL: https://github.com/apache/pulsar-client-go/issues/623


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] zymap closed issue #623: When topic is deleted forced, don't to tigger reconnect logic

Posted by GitBox <gi...@apache.org>.
zymap closed issue #623:
URL: https://github.com/apache/pulsar-client-go/issues/623


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on issue #623: When topic is deleted forced, don't to tigger reconnect logic

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on issue #623:
URL: https://github.com/apache/pulsar-client-go/issues/623#issuecomment-928768695


   And the java demo as follows:
   
   ```
   public static void main(String[] args) throws PulsarClientException {
           PulsarClient client = PulsarClient.builder()
                   .serviceUrl("pulsar://localhost:6650")
                   .build();
   
           final String topic = "test-topic-002";
           final int msgCount = 100000;
   
           Producer<byte[]> producer = client.newProducer()
                   .topic(topic)
                   .create();
           for (int i = 0; i < msgCount; i++) {
               String value = "new msg No." + i;
               MessageId msgId = producer.newMessage()
                       .value(value.getBytes())
                       .send();
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException exception) {
                   exception.printStackTrace();
               }
               System.out.println("===>>> produce msg id:" + new String(msgId.toString()) + ", value:" + value);
           }
           producer.flush();
   }
   ```


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org