Master Issue: #26404
Search before reporting
Motivation
SourceSpec.negativeAckRedeliveryDelayMs sets how long the broker waits before redelivering a negatively acknowledged message. The Go runtime negatively acknowledges on failure:
// pulsar-function-go/pf/instance.go:389-397
func (gi *goInstance) shouldNackInputOnFailure() bool {
...
if gi.shouldNackInputOnFailure() {
but never configures the delay — git grep -in "NegativeAck" -- 'pulsar-function-go/pf/*.go' finds no NackRedeliveryDelay on the consumer options, so the client default (1 minute) always applies.
A function configured with a short redelivery delay for fast retry, or a long one to back off from a struggling downstream, gets neither. The value is accepted and silently replaced by the default.
The Python runtime has the same gap, tracked separately for that runtime. The Java runtime applies it.
Solution
Set NackRedeliveryDelay on the pulsar.ConsumerOptions in setupConsumer when funcDetails.Source.NegativeAckRedeliveryDelayMs > 0, leaving the client default when unset.
The > 0 guard matters: the field is a proto3 scalar with no presence, so zero is indistinguishable from unset, and passing zero through would mean immediate redelivery rather than the default. Java guards the same way (if (sourceSpec.getNegativeAckRedeliveryDelayMs() > 0) in JavaInstanceRunnable).
Alternatives
None. This is a one-line addition to the consumer options with a guard.
Anything else?
Verified against origin/master.
Are you willing to submit a PR?
Master Issue: #26404
Search before reporting
Motivation
SourceSpec.negativeAckRedeliveryDelayMssets how long the broker waits before redelivering a negatively acknowledged message. The Go runtime negatively acknowledges on failure:but never configures the delay —
git grep -in "NegativeAck" -- 'pulsar-function-go/pf/*.go'finds noNackRedeliveryDelayon the consumer options, so the client default (1 minute) always applies.A function configured with a short redelivery delay for fast retry, or a long one to back off from a struggling downstream, gets neither. The value is accepted and silently replaced by the default.
The Python runtime has the same gap, tracked separately for that runtime. The Java runtime applies it.
Solution
Set
NackRedeliveryDelayon thepulsar.ConsumerOptionsinsetupConsumerwhenfuncDetails.Source.NegativeAckRedeliveryDelayMs > 0, leaving the client default when unset.The
> 0guard matters: the field is a proto3 scalar with no presence, so zero is indistinguishable from unset, and passing zero through would mean immediate redelivery rather than the default. Java guards the same way (if (sourceSpec.getNegativeAckRedeliveryDelayMs() > 0)inJavaInstanceRunnable).Alternatives
None. This is a one-line addition to the consumer options with a guard.
Anything else?
Verified against
origin/master.Are you willing to submit a PR?