Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add properties filed for batch (#683)
Signed-off-by: xiaolongran <xiaolongran@tencent.com> ### 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
- Loading branch information