Partitioned outbound gateway for send/edit delivery operations.
The gateway enforces:
- Stable partition routing by
bridge_id:external_room_id - Bounded per-partition queues with pressure transition signals
- Normalized outbound error categories for retry and terminal handling
Summary
Functions
Normalize raw provider/channel failures into gateway categories.
Returns gateway config for an instance module.
Edit media through the outbound gateway.
Edit a message through the outbound gateway.
Returns configured partition count for the gateway.
Resolve a stable partition for a routing key tuple.
Returns a stable routing key used by partition hashing.
Send media through the outbound gateway.
Send a message through the outbound gateway.
Types
@type error_category() :: :retryable | :terminal | :fatal
@type error_response() :: %{ type: :outbound_error, category: error_category(), disposition: :retry | :terminal, operation: operation(), reason: term(), attempt: pos_integer(), max_attempts: pos_integer(), partition: non_neg_integer(), routing_key: String.t(), retryable: boolean() }
@type operation() :: :send | :edit | :send_media | :edit_media
@type priority() :: :critical | :high | :normal | :low
@type request() :: %{ :operation => operation(), :channel => module(), :bridge_id => String.t(), :external_room_id => term(), :payload => String.t() | map(), :opts => keyword(), :routing_key => String.t(), :session_key => Jido.Messaging.SessionManager.session_key(), optional(:external_message_id) => term(), optional(:route_resolution) => Jido.Messaging.SessionManager.resolution(), optional(:idempotency_key) => String.t() | nil, optional(:max_attempts) => pos_integer() | nil, optional(:base_backoff_ms) => pos_integer() | nil, optional(:max_backoff_ms) => pos_integer() | nil, optional(:priority) => priority() }
@type success_response() :: %{ :operation => operation(), :message_id => term(), :result => map(), :partition => non_neg_integer(), :attempts => pos_integer(), :routing_key => String.t(), :pressure_level => :normal | :warn | :degraded | :shed, :idempotent => boolean(), optional(:route_resolution) => Jido.Messaging.SessionManager.resolution(), optional(:security) => map(), optional(:media) => map() }
Functions
@spec classify_error(term()) :: error_category()
Normalize raw provider/channel failures into gateway categories.
Returns gateway config for an instance module.
@spec edit_media(module(), map(), term(), map(), keyword()) :: {:ok, success_response()} | {:error, error_response()}
Edit media through the outbound gateway.
@spec edit_message(module(), map(), term(), String.t(), keyword()) :: {:ok, success_response()} | {:error, error_response()}
Edit a message through the outbound gateway.
@spec partition_count(module()) :: pos_integer()
Returns configured partition count for the gateway.
@spec route_partition(module(), String.t(), term()) :: non_neg_integer()
Resolve a stable partition for a routing key tuple.
Returns a stable routing key used by partition hashing.
@spec send_media(module(), map(), map(), keyword()) :: {:ok, success_response()} | {:error, error_response()}
Send media through the outbound gateway.
@spec send_message(module(), map(), String.t(), keyword()) :: {:ok, success_response()} | {:error, error_response()}
Send a message through the outbound gateway.