merlimat commented on a change in pull request #284:
URL: https://github.com/apache/pulsar-client-go/pull/284#discussion_r442422926



##########
File path: pulsar/consumer_partition.go
##########
@@ -846,11 +844,15 @@ func getPreviousMessage(mid *messageID) *messageID {
 }
 
 func (pc *partitionConsumer) Decompress(msgMeta *pb.MessageMetadata, payload 
internal.Buffer) (internal.Buffer, error) {
-       provider, ok := compressionProviders[msgMeta.GetCompression()]
+       provider, ok := pc.compressionProviders[msgMeta.GetCompression()]
        if !ok {
-               err := fmt.Errorf("unsupported compression type: %v", 
msgMeta.GetCompression())
-               pc.log.WithError(err).Error("Failed to decompress message.")
-               return nil, err
+               var err error
+               if provider, err = 
pc.initializeCompressionProvider(msgMeta.GetCompression()); err != nil {
+                       pc.log.WithError(err).Error("Failed to decompress 
message.")
+                       return nil, err
+               }
+
+               pc.compressionProviders[msgMeta.GetCompression()] = provider

Review comment:
       Yes, it's done at line 683 above




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to