Skip to main content

Basic settings and options

Retry

If the response to a gRPC call corresponds to a configured error, the call is retried. The retry will be executed according to the configured Retry settings. The default retry responses and settings for each API are as follows.

Retry error status code

For more information, please refer to GRPC Github.

ItemDescription
CANCELLEDIf the call is canceled (usually canceled by the calling party)
UNKNOWNThis error can be returned for unknown errors, for example, if a status value received from another address is not defined for that address
- Also for APIs that do not provide information about response errors
DEADLINE_EXCEEDEDThe deadline expired before the call completed
NOT_FOUNDSome requested entity (e.g. a file or path) could not be found
RESOURCE_EXHAUSTEDSome resource is exhausted, or the user quota is insufficient, or the file system as a whole is out of space
ABORTEDUsually when a sequencer check fails, or the operation is aborted due to a concurrency issue, such as in the middle of a transaction
INTERNALInternal error
UNAVAILABLEThe service is currently unavailable
Retry settings
ItemDescription
JitteredWhether to randomly set the delay time
- Most jitters are set to true
InitiAlertryDelayDelays to set before first retry
- Use a value adjusted based on RetryDelayMultiplier
RetryDelayMultiplierNext call retry delay = previous call retry delay * RetryDelayMultiplier
MaxRetryDelaySets a limit on retry delays
- RetryMultiplier cannot set retry delays exceeding this value
InitialRpcTimeoutSet a timeout for the first RPC
- Use a value adjusted based on RpcTimeoutMultiplier
RpcTimeoutMultiplierNext call timeout = previous call timeout * RpcTimeoutMultiplier
MaxRpcTimeoutSets the RPC timeout
- RpcTimeoutMultiplier cannot set the RPC timeout exceeding this value
TotalTimeoutUltimately controls how long we should keep trying remote calls before giving up on the logic entirely
- The higher this value, the more retries we will execute

Publisher retry settings

APIRetry codeDescriptionRetry setting
create topic14     UNAVAILABLE• Initial : 100ms
• Multiplier : 1.3
• Max : 60s
get topic2UNKNOWN
10ABORTED
14UNAVAILABLE
list topics2UNKNOWN
10ABORTED
14UNAVAILABLE
list topic subscriptions2UNKNOWN
10ABORTED
14UNAVAILABLE
update topic14UNAVAILABLE
delete topic14UNAVAILABLE
publish1CANCELLED
2UNKNOWN
4DEADLINE_EXCEEDED
8RESOURCE_EXHAUSTED
10ABORTED
13INTERNAL
14UNAVAILABLE

Subscriber retry settings

APIRetry codeDescriptionRetry setting
create subscription14     UNAVAILABLE• Initial: 100ms
• Multiplier: 1.3
• Max: 60s
get subscription14UNAVAILABLE
list subscriptions14UNAVAILABLE
seek14UNAVAILABLE
update subscription14UNAVAILABLE
delete subscription14UNAVAILABLE
modify ack deadline14UNAVAILABLE
acknowledge14UNAVAILABLE
pull14UNAVAILABLE
streaming pull4DEADLINE_EXCEEDED
8RESOURCE_EXHAUSTED
13INTERNAL
14UNAVAILABLE

Batch processing

When making an API call, messages can be bundled and sent in batches.

Limit Exceeded Behavior

Action to take when the flow control limit is exceeded

  • SignalError: Returns an error.
  • Block: Waits until the request can be made without exceeding the limit. Useful in batch processing where the latency of individual requests is not important.
  • Ignore: Does not use flow control.
APIBatching SettingsElement Count ThresholdRequest Bytes ThresholdDelay ThresholdLimit Exceeded Behavior
publish100   1000 (=1KB)   10ms     SignalError

Logging

You can leave logs for requests and responses (success/failure) in Publish and StreamingPull as statistics.

  • If you set a time interval, the number of successes/failures of publish and pull will be output for each interval.
  • If you want to check the output, you must set it to info level or higher.

The following values ​​can be set for Logger by default.

ItemDescription
LevelLog level
- Default: Panic
OutputLog output
- Default: os.Stdout
StatLogIntervalTime interval to leave logs
Logging example
conf := &ClientConfig{
LogOptions: &LogOptions{
Level: "info",
Output: os.Stdout,
StatLogInterval: 1 * time.Second
}
}
client, err := NewClientWithConfig(ctx, domainID, projectID, conf, opts...)