shohi opened a new issue #288:
URL: https://github.com/apache/pulsar-client-go/issues/288
#### Expected behavior
create the consumer successfully. According to the doc, ReceiverQueueSize
set to `-1` only disables prefetching in consumer.
#### Actual behavior
Panic when creating consumer with the setting.
```
panic: makechan: size out of range
```
Test code
```go
func TestConsumer_NegativeQueueSize(t *testing.T) {
client, err := pulsar.NewClient(pulsar.ClientOptions{
URL: "pulsar://localhost:6650",
})
if err != nil {
t.FailNow()
}
defer client.Close()
consumer, err := client.Subscribe(pulsar.ConsumerOptions{
Topic: "topic",
SubscriptionName: "my-sub",
ReceiverQueueSize: -1,
})
defer func() {
if consumer != nil {
consumer.Close()
}
}()
if err != nil {
t.FailNow()
}
}
```
#### System configuration
**Pulsar version**: 2.5.2
**pulsar-client-go**: latest(861d7af)
----------------------------------------------------------------
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]