crossoverJie commented on code in PR #753:
URL: https://github.com/apache/pulsar-client-go/pull/753#discussion_r849090157


##########
pulsar/consumer_test.go:
##########
@@ -3017,3 +3017,59 @@ func TestEncryptDecryptRedeliveryOnFailure(t *testing.T) 
{
        assert.NotNil(t, msg)
        consumer.Ack(msg)
 }
+
+// Test for issue #664
+func TestIssue664(t *testing.T) {
+       client, err := NewClient(ClientOptions{
+               URL: lookupURL,
+       })
+
+       assert.Nil(t, err)
+       defer client.Close()
+
+       topic := "persistent://public/default/my-topic"
+       ctx := context.Background()
+
+       // create producer
+       producer, err := client.CreateProducer(ProducerOptions{
+               Topic:           topic,
+               DisableBatching: false,
+       })
+       assert.Nil(t, err)
+       defer producer.Close()
+       if _, err = producer.Send(ctx, &ProducerMessage{
+               Payload: []byte(fmt.Sprintf("hello-%d", 10)),
+       }); err != nil {
+               log.Fatal(err)
+       }
+
+       // create consumer
+       consumer, err := client.Subscribe(ConsumerOptions{
+               Topic:            topic,
+               SubscriptionName: "my-sub",
+               Type:             Exclusive,
+               //DLQ:              &DLQPolicy{MaxDeliveries: 10, 
DeadLetterTopic: "dlq-topic"},
+               //RetryEnable:      true,

Review Comment:
   done



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

Reply via email to