This shows how to override the retry policies for dialogflow_es::SessionsClient:
auto options =
.
set<google::cloud::dialogflow_es::
SessionsConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::dialogflow_es::SessionsRetryPolicyOption>(
SessionsLimitedErrorCountRetryPolicy(3)
.clone())
.set<google::cloud::dialogflow_es::SessionsBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
auto connection =
connection,
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
A service used for session interactions.
Definition: sessions_client.h:64
Definition: agents_client.h:33
std::shared_ptr< SessionsConnection > MakeSessionsConnection(std::string const &location, Options options={})
A factory function to construct an object of type SessionsConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< dialogflow_es_internal::SessionsRetryTraits > SessionsLimitedTimeRetryPolicy
Definition: sessions_connection.h:43
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: sessions_options.h:39
Assuming you have created a custom idempotency policy. Such as:
class CustomIdempotencyPolicy
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: sessions_connection_idempotency_policy.h:33
virtual std::unique_ptr< SessionsConnectionIdempotencyPolicy > clone() const
Create a new copy of this object.