An in-process pub/sub transport backed by Registry and GenServer.
This transport is:
- Always available — no external broker required.
- Used in test environments to avoid broker dependencies.
- Fully functional — supports publish, subscribe, ack, nack, wildcard topics, consumer groups, and dead-letter queues.
- Observable — emits all standard Telemetry events.
Wildcard support
Wildcards follow the NATS convention:
*matches a single token:"payments.*"matches"payments.created".>matches the rest:"payments.>"matches"payments.created.v2".
Usage in config
config :phoenix_micro, transport: :memoryUsage in tests
setup do
{:ok, _pid} = start_supervised(PhoenixMicro.Transport.Memory)
:ok
end
Summary
Functions
Returns a specification to start this module under a supervisor.
Clears the message log. Useful between test cases.
Returns all dead-lettered messages.
Returns all messages published since start (useful in tests).
Blocks until at least count messages matching topic have been received.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Clears the message log. Useful between test cases.
Returns all dead-lettered messages.
Returns all messages published since start (useful in tests).
@spec start_link(keyword()) :: GenServer.on_start()
@spec wait_for_messages(String.t(), pos_integer(), timeout()) :: :ok | :timeout
Blocks until at least count messages matching topic have been received.