1

We are using AWS Sns lient to pub/sub. I have found during creating SnsClient we can use reties to define the maximum number of retries. For example,

    $args = [
        'region' => $region,
        'retries' => $retries,
        'credentials' => [
            'key' => $keyId,
            'secret' => $keySecret,
        ],
        'version' => $version,
        'http' => [
            'connect_timeout' => $connectTimeout,
        ],
    ];

    $aws = new Sdk($args);
    $client = $aws->createSns();
    $client->publish(..);

Is there is a way to log the exception if there is some kind of retry used? I mean I wanna control the retry policy using the above code.

Imran Qadir Baksh - Baloch
  • 32,612
  • 68
  • 179
  • 322

1 Answers1

0

No, but you can turn off build in retry policy and create your own https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html#config-retries ```

// Disable retries by setting "retries" to 0
$client = new Aws\DynamoDb\DynamoDbClient([
    'version' => '2012-08-10',
    'region'  => 'us-west-2',
    'retries' => 0
]);

```

Anatoli Klamer
  • 2,279
  • 2
  • 17
  • 22