Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nack backoff policy may not be used #801

Open
davendu opened this issue Jul 1, 2022 · 1 comment
Open

nack backoff policy may not be used #801

davendu opened this issue Jul 1, 2022 · 1 comment

Comments

@davendu
Copy link

davendu commented Jul 1, 2022

In PIP-106 and #660, the Pulsar SDK for Golang has supported NackBackoffPolicy. However, using a topic with 1 partition, the following code may not use the backoff policy:

polarisConsumer := p.consumers[priority], err = client.Subscribe(pulsar.ConsumerOptions{
	Topic:            "demoTopic",
	SubscriptionName: "demoSubscriptionName",
	Type:             pulsar.Shared,
	RetryEnable:      true,
	DLQ: &pulsar.DLQPolicy{
		MaxDeliveries: 10, 
	},
	EnableDefaultNackBackoffPolicy: true,
})
msg := <-polarisConsumer.Chan()
msg.Nack(msg)

After some digging I found the following call stack:

And in the implementation of Add() method, it's obviously impossible to use the back off policy, since redeliver count is not available, so default back off delay is used.

I'm not sure if my code is using the back off policy in the right way, or this is a bug in the SDK, or our broker is having some issue.

@flowchartsman
Copy link
Contributor

flowchartsman commented Jun 7, 2023

Isn't this fixed by #974?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants