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/04/07 17:17:51 UTC

[GitHub] [pulsar-client-go] crossoverJie opened a new issue #503: SendAsync sometimes returns the same MessageID

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


   #### Expected behavior
   They are different IDs, and the message was sent successfully.
   
   
   #### Actual behavior
   
   ```
   14620:160:0 Published message:abc 
   14620:160:0 Published message:def 
   ```
   Sometimes returns the same MessageID, and one of the messages failed to be sent.
   
   
   #### Steps to reproduce
   
   ```go
   	msgList := [][]byte{[]byte("abc"), []byte("def")}
   	for _, msg := range msgList {
   		producer.SendAsync(context.Background(), &pulsar.ProducerMessage{
   			Payload: msg,
   		}, func(messageID pulsar.MessageID, producerMessage *pulsar.ProducerMessage, err error) {
   			if err != nil {
   				fmt.Println("Failed to publish message", err)
   				return
   			}
   			fmt.Printf("%s Published message:%v \n", messageID, string(producerMessage.Payload))
   		})
   	}
   ```
   
   But the Java client does not have this problem.
   
   ```java
           List<String> msgList = new ArrayList<>();
           msgList.add("abc");
           msgList.add("def");
           msgList.forEach(msg -> {
               producer.sendAsync(msg.getBytes()).thenAccept(msgId -> {
                   System.out.printf("Message with ID %s successfully sent \n", msgId);
               });
           });
   ```
   
   output:
   ```
   Message with ID 14620:155:-1:0 successfully sent
   Message with ID 14620:156:-1:0 successfully sent
   ```
   
   #### System configuration
   **Pulsar version**: 2.7.1
   Go SDK: v0.3.0
   Java SDK: 2.7.1
   


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

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



[GitHub] [pulsar-client-go] crossoverJie commented on issue #503: SendAsync sometimes returns the same MessageID

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


   After testing, I found that the message could be sent successfully.
   
   When I send two messages, they are only added once in the statistics of the admin desk.
   
   ![image](https://user-images.githubusercontent.com/15684156/113991368-f5b02980-9884-11eb-982b-492f5e8b4bf8.png)
   
   Is it because the batch information is recorded here?
   
   


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

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