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


##########
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:
   oh, it doesn't seem to be the case in pulsar-client-go: 
https://github.com/apache/pulsar-client-go/blob/393f80b4b93faa36936380b643426026a2b2cd02/pulsar/consumer_impl.go#L116-L168
   
   In the Java client, this is different. It seems to make sense that DLQ 
feature is independent of retrying, but that's not how pulsar-client-go is 
implemented.



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