Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
The bytes of the retryConditions at the given index.
getRetryConditionsCount()
publicabstractintgetRetryConditionsCount()
Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
Specifies one or more conditions when this retry policy applies. Valid
values are:
5xx: Proxy will attempt a retry if the destination service responds
with any 5xx response code, of if the destination service does not
respond at all, example: disconnect, reset, read timeout, connection
failure and refused streams.
gateway-error: Similar to 5xx, but only applies to response codes 502,
503, 504.
reset: Proxy will attempt a retry if the destination service does not
respond at all (disconnect/reset/read timeout)
connect-failure: Proxy will retry on failures connecting to destination
for example due to connection timeouts.
retriable-4xx: Proxy will retry fro retriable 4xx response codes.
Currently the only retriable error supported is 409.
refused-stream: Proxy will retry if the destination resets the stream
with a REFUSED_STREAM error code. This reset type indicates that it
is safe to retry.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface HttpRoute.RetryPolicyOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.networkservices.v1.HttpRoute.RetryPolicyOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.networkservices.v1.HttpRoute.RetryPolicyOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.networkservices.v1.HttpRoute.RetryPolicyOrBuilder) \n\n public static interface HttpRoute.RetryPolicyOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getNumRetries()\n\n public abstract int getNumRetries()\n\nSpecifies the allowed number of retries. This number must be \\\u003e 0. If not\nspecified, default to 1.\n\n`int32 num_retries = 2;`\n\n### getPerTryTimeout()\n\n public abstract Duration getPerTryTimeout()\n\nSpecifies a non-zero timeout per retry attempt.\n\n`.google.protobuf.Duration per_try_timeout = 3;`\n\n### getPerTryTimeoutOrBuilder()\n\n public abstract DurationOrBuilder getPerTryTimeoutOrBuilder()\n\nSpecifies a non-zero timeout per retry attempt.\n\n`.google.protobuf.Duration per_try_timeout = 3;`\n\n### getRetryConditions(int index)\n\n public abstract String getRetryConditions(int index)\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n`repeated string retry_conditions = 1;`\n\n### getRetryConditionsBytes(int index)\n\n public abstract ByteString getRetryConditionsBytes(int index)\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n`repeated string retry_conditions = 1;`\n\n### getRetryConditionsCount()\n\n public abstract int getRetryConditionsCount()\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n`repeated string retry_conditions = 1;`\n\n### getRetryConditionsList()\n\n public abstract List\u003cString\u003e getRetryConditionsList()\n\nSpecifies one or more conditions when this retry policy applies. Valid\nvalues are:\n5xx: Proxy will attempt a retry if the destination service responds\nwith any 5xx response code, of if the destination service does not\nrespond at all, example: disconnect, reset, read timeout, connection\nfailure and refused streams.\ngateway-error: Similar to 5xx, but only applies to response codes 502,\n503, 504.\nreset: Proxy will attempt a retry if the destination service does not\nrespond at all (disconnect/reset/read timeout)\nconnect-failure: Proxy will retry on failures connecting to destination\nfor example due to connection timeouts.\nretriable-4xx: Proxy will retry fro retriable 4xx response codes.\nCurrently the only retriable error supported is 409.\nrefused-stream: Proxy will retry if the destination resets the stream\nwith a REFUSED_STREAM error code. This reset type indicates that it\nis safe to retry.\n\n`repeated string retry_conditions = 1;`\n\n### hasPerTryTimeout()\n\n public abstract boolean hasPerTryTimeout()\n\nSpecifies a non-zero timeout per retry attempt.\n\n`.google.protobuf.Duration per_try_timeout = 3;`"]]