Configuration for KubeMQ client connections via NimbleOptions.
All timeouts are in milliseconds, matching Elixir/Erlang convention. The SDK converts internally for proto fields that use different units.
Unit Conversions
| User-Facing Field | User Unit | Proto Field | Proto Unit | Conversion |
|---|---|---|---|---|
default_cache_ttl | ms | CacheTTL | seconds | div(ms, 1000) |
cache_ttl (Query) | ms | CacheTTL | seconds | div(ms, 1000) |
wait_timeout (Simple) | ms | WaitTimeSeconds | seconds | div(ms, 1000) |
wait_timeout (Stream) | ms | WaitTimeout | ms | pass-through |
start_at_time_delta | ms | EventsStoreTypeValue | seconds | div(ms, 1000) |
timeout (CQ) | ms | Timeout | ms | pass-through |
Summary
Functions
Validate and apply defaults to client options.
Validate and apply defaults to client options, raising on invalid input.
Functions
@spec schema() :: keyword()
@spec validate(keyword()) :: {:ok, keyword()} | {:error, NimbleOptions.ValidationError.t()}
Validate and apply defaults to client options.
Returns {:ok, validated_opts} on success or {:error, validation_error} on failure.
Examples
iex> {:ok, opts} = KubeMQ.Config.validate(client_id: "test")
iex> Keyword.get(opts, :client_id)
"test"
iex> {:error, %NimbleOptions.ValidationError{}} = KubeMQ.Config.validate([])
Validate and apply defaults to client options, raising on invalid input.
Returns the validated keyword list with all defaults applied.
Raises NimbleOptions.ValidationError if validation fails.
Examples
iex> opts = KubeMQ.Config.validate!(client_id: "my-app")
iex> Keyword.get(opts, :address)
"localhost:50000"