Skip to content

Commit

Permalink
Remove RetryEnable
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Apr 9, 2024
1 parent 9461c8f commit 18c98a4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pulsar-function-go/pf/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,15 @@ func (gi *goInstance) setupConsumer() (chan pulsar.ConsumerMessage, error) {
}

var dlqPolicy *pulsar.DLQPolicy
retryEnable := false
if retryDetails := gi.context.instanceConf.funcDetails.RetryDetails; retryDetails != nil {
retryDetails := gi.context.instanceConf.funcDetails.RetryDetails
if retryDetails != nil && retryDetails.DeadLetterTopic != "" {
dlqPolicy = &pulsar.DLQPolicy{
DeadLetterTopic: retryDetails.DeadLetterTopic,
}

if retryDetails.MaxMessageRetries >= 0 {
dlqPolicy.MaxDeliveries = uint32(retryDetails.MaxMessageRetries)
}
retryEnable = true
}

properties := getProperties(getDefaultSubscriptionName(
Expand Down Expand Up @@ -361,7 +360,6 @@ func (gi *goInstance) setupConsumer() (chan pulsar.ConsumerMessage, error) {
MessageChannel: channel,
SubscriptionInitialPosition: subscriptionPosition,
DLQ: dlqPolicy,
RetryEnable: retryEnable,
})
} else {
consumer, err = gi.client.Subscribe(pulsar.ConsumerOptions{
Expand All @@ -373,7 +371,6 @@ func (gi *goInstance) setupConsumer() (chan pulsar.ConsumerMessage, error) {
MessageChannel: channel,
SubscriptionInitialPosition: subscriptionPosition,
DLQ: dlqPolicy,
RetryEnable: retryEnable,
})
}
} else {
Expand All @@ -386,7 +383,6 @@ func (gi *goInstance) setupConsumer() (chan pulsar.ConsumerMessage, error) {
MessageChannel: channel,
SubscriptionInitialPosition: subscriptionPosition,
DLQ: dlqPolicy,
RetryEnable: retryEnable,
})
} else {
consumer, err = gi.client.Subscribe(pulsar.ConsumerOptions{
Expand All @@ -397,7 +393,6 @@ func (gi *goInstance) setupConsumer() (chan pulsar.ConsumerMessage, error) {
MessageChannel: channel,
SubscriptionInitialPosition: subscriptionPosition,
DLQ: dlqPolicy,
RetryEnable: retryEnable,
})

}
Expand Down

0 comments on commit 18c98a4

Please sign in to comment.