Sonalit23 opened a new issue, #1103:
URL: https://github.com/apache/pulsar-client-go/issues/1103

   #### Expected behavior
   
   Sending pulsar message with value type Boolean (wrapper class) in java with 
RSA encryption enabled but unable to read it at consumer side with go client. 
correct boolean value should be received provided correct decryption keys.
   
   #### Actual behavior
   
   value is always empty and not sure what will be the right schema type for 
boolean value.
   
   #### Steps to reproduce
   
   Here I am writing producer in go (integration test) instead of JAVA.
   producer code:
   ```
   keyReader := crypto.NewFileKeyReader('PROVIDE PATH TO PUBLIC KEY', 'PROVIDE 
PATH TO PRIVATE KEY')
        producer, _ := client.CreateProducer(pulsar.ProducerOptions{
                Topic: "some-topic",
                Encryption: &pulsar.ProducerEncryptionInfo{
                        KeyReader:                   keyReader,
                        ProducerCryptoFailureAction: 
crypto.ProducerCryptoFailureActionFail,
                        Keys:                        []string{"client-rsa.pem"},
                },
        })
   
        msgId, err := producer.Send(ctx, &pulsar.ProducerMessage{
                Key:   "abc-key",
                Value: true,
        })
   ```
   Consumer code:
   ```
   keyReader := crypto.NewFileKeyReader('PROVIDE PATH TO PUBLIC KEY', 'PROVIDE 
PATH TO PRIVATE KEY')
        options := pulsar.ConsumerOptions{
                Topic:            topic-name,
                Type:             pulsar.Shared,
                MessageChannel:              channel,
                SubscriptionInitialPosition: 
pulsar.SubscriptionPositionEarliest,
                Decryption: &pulsar.MessageDecryptionInfo{
                        KeyReader:                   keyReader,
                        ConsumerCryptoFailureAction: 
crypto.ConsumerCryptoFailureActionFail,
                },
        }
   ```
   
   How to use schematype for BOOLEAN value? I checked the 
https://github.com/apache/pulsar-client-go/blob/master/pulsar/schema.go but it 
is unclear for boolean value. any help would be appreciated.
   #### System configuration
   **Pulsar version**: 3.0.x
   


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

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

Reply via email to