tomas-c opened a new issue #8484:
URL: https://github.com/apache/pulsar/issues/8484
Hey everyone,
I'm a bit confused about the usage of Dead Letter Queue with NACKs.
Initially I had a shared consumer like so (apologies for my Kotlin) and was
using NACKs:
```
val jobConsumer =
pulsarClient.newConsumer(JSONSchema.of(jobDefinition))
.topic("<removed>")
.subscriptionName("<removed>")
.subscriptionType(SubscriptionType.Shared)
.receiverQueueSize(0)
.subscribeAsync()
.await()
```
Later I decided it would be good to make sure failed messages don't get
redelivered too many times so I added a dead letter policy:
```
val jobConsumer =
pulsarClient.newConsumer(JSONSchema.of(jobDefinition))
.topic("<removed>")
.subscriptionName("<removed>")
.subscriptionType(SubscriptionType.Shared)
.receiverQueueSize(0)
.deadLetterPolicy(DeadLetterPolicy.builder()
.maxRedeliverCount(2)
.build())
.subscribeAsync()
.await()
```
#### Expected behavior
I expected this to start forwarding messages after 2 deliveries to the DLQ
and nothing else to change.
#### Actual behavior
What happened was that the ackTimeoutMillis got set to 30s behind the scenes
(this is documented behavior but I didn't expect it...) and then all my
messages started timing out because each was originally taking more than 30s to
process.
I see this default setting was introduced by #3014
#### System configuration
**Pulsar version**: 2.6.1
Is it safe to override the ackTimeoutMillis timeout that was set by the
deadLetterPolicy() call and just set it to 0 again? Is there any reason why DLQ
would not work when ack timeouts are disabled and NACKs are used instead?
Thanks!
----------------------------------------------------------------
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]