Per-instance message sender with retry queue and exponential backoff.
Handles outbound message delivery with:
- Queued delivery (non-blocking for callers)
- Exponential backoff with jitter on failures
- Configurable max attempts
- Telemetry signals for delivery lifecycle
Signals Emitted
[:jido_messaging, :delivery, :queued][:jido_messaging, :delivery, :attempt][:jido_messaging, :delivery, :retry_scheduled][:jido_messaging, :delivery, :gave_up]
Summary
Functions
Returns a specification to start this module under a supervisor.
Enqueue a message for delivery.
Get the external message ID for a previously sent message
Check if a message has already been sent (by idempotency key)
Get current queue size
Returns the Zoi schema
Get the sender pid for an instance
Types
@type t() :: %Jido.Messaging.Sender{ base_backoff_ms: integer(), channel: any(), instance_id: binary(), instance_module: any(), instance_server: nil | nil | any(), max_attempts: integer(), max_backoff_ms: integer(), queue: any(), queue_size: integer(), sent_cache_size: integer(), sent_messages: map(), sent_order: [binary()] }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec enqueue(pid(), String.t(), term(), String.t(), map()) :: {:ok, String.t()} | {:error, :queue_full}
Enqueue a message for delivery.
Returns {:ok, job_id} if queued successfully, {:error, :queue_full} if at capacity.
Get the external message ID for a previously sent message
Check if a message has already been sent (by idempotency key)
@spec queue_size(pid()) :: non_neg_integer()
Get current queue size
Returns the Zoi schema
Get the sender pid for an instance