You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and then never reads it. git grep -in "DLQ\|DeadLetter\|MaxRedeliver" -- 'pulsar-function-go/pf/*.go' returns only that one construction site. No pulsar.DLQPolicy is ever built, and setupConsumer passes no DLQ options to Subscribe.
The configuration is therefore accepted end to end and has no effect: a Go function created with --dead-letter-topic and --max-message-retries reports both back from functions get, and messages that fail repeatedly are redelivered forever instead of being routed to the dead letter topic. The Java runtime applies them in PulsarSource (guarded by hasRetryDetails() in JavaInstanceRunnable).
Populating the field and never consuming it is worse than not carrying it at all — it makes the gap invisible to anyone reading the instance configuration.
Solution
Build a pulsar.DLQPolicy from funcDetails.RetryDetails in setupConsumer and pass it in the ConsumerOptions. The Go client supports this:
Points worth settling, mirroring the ones raised on the Python fix in #26400:
Presence check.RetryDetails is a message field, so funcDetails.GetRetryDetails() != nil is the equivalent of Java's hasRetryDetails(). A scalar check on MaxMessageRetries cannot distinguish unset from zero.
Empty deadLetterTopic. Java sets the topic only when non-empty, leaving the client to derive <topic>-<subscription>-DLQ. Passing an empty string through would override that with an invalid name.
Removing the RetryDetails construction so the configuration is visibly absent would be honest but strictly less useful — the fields are already plumbed, and the Go client supports the feature.
Master Issue: #26404
Search before reporting
Motivation
The Go runtime builds
RetryDetailsinto its ownFunctionDetailsfrom the instance configuration:and then never reads it.
git grep -in "DLQ\|DeadLetter\|MaxRedeliver" -- 'pulsar-function-go/pf/*.go'returns only that one construction site. Nopulsar.DLQPolicyis ever built, andsetupConsumerpasses no DLQ options toSubscribe.The configuration is therefore accepted end to end and has no effect: a Go function created with
--dead-letter-topicand--max-message-retriesreports both back fromfunctions get, and messages that fail repeatedly are redelivered forever instead of being routed to the dead letter topic. The Java runtime applies them inPulsarSource(guarded byhasRetryDetails()inJavaInstanceRunnable).Populating the field and never consuming it is worse than not carrying it at all — it makes the gap invisible to anyone reading the instance configuration.
Solution
Build a
pulsar.DLQPolicyfromfuncDetails.RetryDetailsinsetupConsumerand pass it in theConsumerOptions. The Go client supports this:Points worth settling, mirroring the ones raised on the Python fix in #26400:
RetryDetailsis a message field, sofuncDetails.GetRetryDetails() != nilis the equivalent of Java'shasRetryDetails(). A scalar check onMaxMessageRetriescannot distinguish unset from zero.maxMessageRetriesof 0. Java accepts>= 0. Whether the Go client'sMaxDeliveriesaccepts 0 meaningfully should be confirmed rather than assumed — the Python client rejects a redelivery count below 1, which is why [fix][fn] Honour deadLetterTopic and maxMessageRetries in the Python function runtime #26400 attaches no policy in that case and warns.deadLetterTopic. Java sets the topic only when non-empty, leaving the client to derive<topic>-<subscription>-DLQ. Passing an empty string through would override that with an invalid name.retainOrderingcurrently selects nothing andretainKeyOrderingis ignored; whichever lands second should handle the combination rather than silently producing an ineffective policy.Alternatives
Removing the
RetryDetailsconstruction so the configuration is visibly absent would be honest but strictly less useful — the fields are already plumbed, and the Go client supports the feature.Anything else?
Verified against
origin/master.Are you willing to submit a PR?