Do not retry forever by default

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
ItalyPaleAle 2023-01-20 04:24:35 +00:00
parent 885fb5a2d4
commit 01e7d4167b
1 changed files with 4 additions and 1 deletions

View File

@ -105,7 +105,10 @@ func (aeh *AzureEventHubs) Init(metadata pubsub.Metadata) error {
}
}
// Default retry configuration is used if no backOff properties are set.
// Default retry configuration is used if no backOff properties are set
// backOff max retry config is set to 3, which means 3 retries by default
aeh.backOffConfig = retry.DefaultConfig()
aeh.backOffConfig.MaxRetries = 3
err = retry.DecodeConfigWithPrefix(&aeh.backOffConfig, metadata.Properties, "backOff")
if err != nil {
return fmt.Errorf("failed to decode backoff configuration")