Command message for the KubeMQ RPC pattern.
Commands are fire-and-wait messages: the sender blocks until the receiver executes and responds, or the timeout expires.
Fields
id(String.t() | nil) — Unique command identifier. Auto-generated if nil.channel(String.t()) — Target channel name. Required for sending.metadata(String.t() | nil) — Optional metadata string.body(binary() | nil) — Command payload.timeout(pos_integer()) — Timeout in milliseconds. Default:10_000.client_id(String.t() | nil) — Sender identifier. Set automatically byKubeMQ.Client.tags(%{String.t() => String.t()}) — Key-value tags. Default:%{}.span(binary() | nil) — Tracing span context (internal).
Usage
cmd = KubeMQ.Command.new(channel: "orders.process", body: payload, timeout: 10_000)
{:ok, response} = KubeMQ.Client.send_command(client, cmd)
Summary
Functions
Create a new Command struct from keyword options.
Types
Functions
Create a new Command struct from keyword options.
Options
:id— Command ID string (auto-generated if nil):channel— Target channel name (required for sending):metadata— Metadata string:body— Command payload (binary):timeout— Timeout in milliseconds (default:10_000):client_id— Client identifier (set automatically byKubeMQ.Client):tags— Key-value tags map (default:%{})
Examples
iex> cmd = KubeMQ.Command.new(channel: "orders.process", body: "data")
iex> cmd.channel
"orders.process"
iex> cmd.timeout
10000