High-level message producer with batching, async fire-and-forget, and sync-with-ack publishing.
Usage
# Async fire-and-forget
PhoenixMicro.Producer.publish("payments.created", %{amount: 100})
# Sync with confirmation
:ok = PhoenixMicro.Producer.publish_sync("payments.created", %{amount: 100})
# Batch publish
messages = [
{"payments.created", %{amount: 100}},
{"payments.created", %{amount: 200}}
]
PhoenixMicro.Producer.publish_batch(messages)
Summary
Functions
Returns a specification to start this module under a supervisor.
Publishes a message asynchronously (fire-and-forget). Returns immediately; does not wait for broker acknowledgment.
Publishes multiple messages, automatically batching them.
Publishes a message synchronously, waiting for broker confirmation.
Returns :ok or {:error, reason}.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Publishes a message asynchronously (fire-and-forget). Returns immediately; does not wait for broker acknowledgment.
Publishes multiple messages, automatically batching them.
Publishes a message synchronously, waiting for broker confirmation.
Returns :ok or {:error, reason}.
@spec start_link(keyword()) :: GenServer.on_start()