nodece commented on code in PR #1278:
URL: https://github.com/apache/pulsar-client-go/pull/1278#discussion_r1882030452
##########
pulsar/consumer_zero_queue_test.go:
##########
@@ -95,6 +95,89 @@ func TestNormalZeroQueueConsumer(t *testing.T) {
err = consumer.Unsubscribe()
assert.Nil(t, err)
}
+
+func TestMultipleConsumer(t *testing.T) {
+ client, err := NewClient(ClientOptions{
+ URL: lookupURL,
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer client.Close()
+
+ topic := newTopicName()
+ ctx := context.Background()
+
+ // create consumer1
+ consumer1, err := client.Subscribe(ConsumerOptions{
+ Topic: topic,
+ SubscriptionName: "my-sub",
+ Type: Shared,
+ EnableZeroQueueConsumer: true,
+ })
+ assert.Nil(t, err)
+ _, ok := consumer1.(*zeroQueueConsumer)
+ assert.True(t, ok)
+ defer consumer1.Close()
+
+ // create consumer2
+ consumer2, err := client.Subscribe(ConsumerOptions{
+ Topic: topic,
+ SubscriptionName: "my-sub",
+ Type: Shared,
+ EnableZeroQueueConsumer: true,
+ })
+ assert.Nil(t, err)
+ _, ok = consumer2.(*zeroQueueConsumer)
+ assert.True(t, ok)
+ defer consumer2.Close()
+
+ // create producer
+ producer, err := client.CreateProducer(ProducerOptions{
+ Topic: topic,
+ DisableBatching: false,
Review Comment:
```suggestion
DisableBatching: true,
```
Is it right?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]