GenServer that polls the outbox_messages table and relays undelivered
messages to the configured transport.
Requires ecto_sql in your application's deps:
{:ecto_sql, "~> 3.11"}Behaviour
Every :poll_interval_ms (default 1000ms) the relay:
- Selects up to
:batch_sizerows whererelayed_at IS NULLandattempt <= max_attempts, ordered byinserted_at ASC. - For each row, calls
PhoenixMicro.publish_sync/3. - On success: marks
relayed_at = now(). - On failure: increments
attempt, setslast_error. Onceattempt > max_attempts, setsfailed_at = now()and gives up.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()