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 2022/04/13 05:32:10 UTC

[GitHub] [pulsar-client-go] crossoverJie commented on a diff in pull request #753: [Issue 664] fix ReconsumeLater panic

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org