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



##########
File path: pulsar/producer_partition.go
##########
@@ -126,6 +129,29 @@ func newPartitionProducer(client *client, topic string, 
options *ProducerOptions
                p.producerName = options.Name
        }
 
+       encryption := options.Encryption
+       // add default message crypto if not provided
+       if encryption != nil && len(encryption.Keys) > 0 {
+               if encryption.KeyReader == nil {
+                       return nil, fmt.Errorf("encryption is enabled, 
KeyReader can not be nil")
+               }
+
+               if encryption.MessageCrypto == nil {
+                       logCtx := fmt.Sprintf("[%v] [%v] [%v]", p.topic, 
p.producerName, p.producerID)

Review comment:
       Sure




-- 
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-unsubscr...@pulsar.apache.org

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


Reply via email to