This shows how to override the retry policies for dialogflow_cx::DeploymentsClient:
auto options =
.
set<google::cloud::dialogflow_cx::
DeploymentsConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::dialogflow_cx::DeploymentsRetryPolicyOption>(
DeploymentsLimitedErrorCountRetryPolicy(3)
.clone())
.set<google::cloud::dialogflow_cx::DeploymentsBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
auto connection =
connection,
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
Service for managing Deployments.
Definition: deployments_client.h:65
Definition: agents_client.h:33
::google::cloud::internal::LimitedTimeRetryPolicy< dialogflow_cx_internal::DeploymentsRetryTraits > DeploymentsLimitedTimeRetryPolicy
Definition: deployments_connection.h:43
std::shared_ptr< DeploymentsConnection > MakeDeploymentsConnection(std::string const &location, Options options={})
A factory function to construct an object of type DeploymentsConnection.
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: deployments_options.h:39
Assuming you have created a custom idempotency policy. Such as:
DeploymentsConnectionIdempotencyPolicy {
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: deployments_connection_idempotency_policy.h:33