GPrabhudas commented on a change in pull request #560:
URL: https://github.com/apache/pulsar-client-go/pull/560#discussion_r667628468



##########
File path: pulsar/internal/commands.go
##########
@@ -269,6 +270,117 @@ func serializeBatch(wb Buffer,
        wb.PutUint32(checksum, checksumIdx)
 }
 
+// copy of the method serializeBatch(....) with an extension to encrypt payload
+func serializeBatchWithEncryption(wb Buffer,
+       cmdSend *pb.BaseCommand,
+       msgMetadata *pb.MessageMetadata,
+       uncompressedPayload Buffer,
+       compressionProvider compression.Provider,
+       KeyReader crypto.KeyReader,
+       encryptionKeys []string,
+       msgCrypto crypto.MessageCrypto,
+       cryptoFailureAction int,
+) {
+       // Wire format
+       // [TOTAL_SIZE] [CMD_SIZE][CMD] [MAGIC_NUMBER][CHECKSUM] 
[METADATA_SIZE][METADATA] [PAYLOAD]
+
+       // compress the payload
+       compressedPayload := compressionProvider.Compress(nil, 
uncompressedPayload.ReadableSlice())

Review comment:
       As per java implementation => Yes compress and the encrypt.




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