You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/19 03:39:38 UTC

[GitHub] [pulsar-client-go] wolfstudy commented on a change in pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

wolfstudy commented on a change in pull request #289:
URL: https://github.com/apache/pulsar-client-go/pull/289#discussion_r442614155



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       Maybe we can fix it using follows way:
   
   ```
   	if options.ReceiverQueueSize <= 0 {
   		options.ReceiverQueueSize = 1000
   	}
   ```




----------------------------------------------------------------
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:
users@infra.apache.org