jiangpengcheng commented on code in PR #22457:
URL: https://github.com/apache/pulsar/pull/22457#discussion_r1556659413


##########
pulsar-function-go/pf/instance.go:
##########
@@ -312,6 +312,24 @@ func (gi *goInstance) setupConsumer() (chan 
pulsar.ConsumerMessage, error) {
                subscriptionName = funcDetails.Source.SubscriptionName
        }
 
+       subscriptionPosition := pulsar.SubscriptionPositionLatest
+       if gi.context.instanceConf.funcDetails.Source.SubscriptionPosition == 
pb.SubscriptionPosition_EARLIEST {
+               subscriptionPosition = pulsar.SubscriptionPositionEarliest
+       }
+
+       var dlqPolicy *pulsar.DLQPolicy
+       retryEnable := false
+       if retryDetails := gi.context.instanceConf.funcDetails.RetryDetails; 
retryDetails != nil {
+               dlqPolicy = &pulsar.DLQPolicy{
+                       DeadLetterTopic: retryDetails.DeadLetterTopic,
+               }
+
+               if retryDetails.MaxMessageRetries >= 0 {
+                       dlqPolicy.MaxDeliveries = 
uint32(retryDetails.MaxMessageRetries)
+               }
+               retryEnable = true

Review Comment:
   seems it's more reasonable to leave `RetryEnable` to false here, then it 
just won't set the default `DeadLetterTopic`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to