wolfstudy opened a new pull request #683:
URL: https://github.com/apache/pulsar-client-go/pull/683


   Signed-off-by: xiaolongran <[email protected]>
   
   ### Motivation
   
   Currently, when we disable batch in Producer, in `handleSend()` of 
`serverCnx.java`, the `msgMetadata.hasNumMessagesInBatch()` is **true** and 
`msgMetadata.getNumMessagesInBatch()` is **1**.
   
   At this point, if we get the Properties object we set on the producer side 
on the broker side, the display is empty.
   
   Go SDK set Properties:
   
   ```
   
   // disable batch
   producer, err := client.CreateProducer(pulsar.ProducerOptions{
        Topic: "topic-1",
        DisableBatching: true,
   })
   
   // set properties for every message
   producer.Send(ctx, &pulsar.ProducerMessage{
        Payload: []byte(fmt.Sprintf("hello-%d", i)),
        Properties: map[string]string{
                "key-1": "value-1",
        },
   });
   ```
   
   Broker get message properties from entry metadata is null:
   
   ```
   ByteBuf metadataAndPayload = entry.getDataBuffer();
   
   MessageMetadata msgMetadata = 
Commands.peekMessageMetadata(metadataAndPayload, subscription.toString(), -1);
   ```
   
   And `msgMetadata.getPropertiesCount() <= 0`.
   
   
   ### Modifications
   
   Add properties filed in Add single message to batchContainer
   
   


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