【问题标题】:Log retry exception in Aws SnsClientAws SnsClient 中的日志重试异常
【发布时间】:2018-12-05 15:42:23
【问题描述】:

我们正在使用 AWS Sns 对 pub/sub 的授权。我在创建 SnsClient 期间发现我们可以使用 reties 来定义最大重试次数。例如,

    $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(..);

如果使用了某种重试,有没有办法记录异常?我的意思是我想使用上面的代码来控制重试策略。

【问题讨论】:

    标签: php amazon-web-services amazon-sns retrypolicy


    【解决方案1】:

    否,但您可以关闭内置重试策略并创建自己的 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
    ]);
    

    ```

    【讨论】:

    • 你能具体说明一下吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-24
    • 2019-05-28
    • 2018-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多