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


##########
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:
   isn't `RetryEnable` related to having RetryLetterTopic defined?
   
   
https://github.com/apache/pulsar-client-go/blob/393f80b4b93faa36936380b643426026a2b2cd02/pulsar/retry_router.go#L62-L75
   
   I'd assume that `DeadLetterTopic` can be set without setting `RetryEnable`.



-- 
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