off_broadway_mqtt v0.1.0 OffBroadway.MQTT.Producer View Source

Acts as Producer for messages from a MQTT topic subscription.

Features

  • Retrying messages based on fail reason in the message status.
  • Telemetry events.
  • Gently handles connection outages thanks to Tortoise.
  • Customizeable behaviour by dependency injection.

Options

The producer requires on start a single argument - a list containing as the

Any further keywords are passed as options to OffBroadway.MQTT.Client.start/2.

Notes

  • The buffer queues are started and registered based on topics. If you are using shared subscriptions you will have a single queue for buffering the incoming messages.
  • The default queue keeps buffered messages only in memory. If the queue supervisor terminates all unprocessed messages are lost.
  • The buffer queues are supervised independently and don't shut down with the producer. That way a restarted producer on the same topic can pick up where the faulty one stopped. You might need to stop queues manually if stopping a producer on purpose.

Link to this section Summary

Types

Type for the argument passed to the producer on start.

Type for optios that can be passed to the producer.

Collection type for options to start the producer with.

Internal state of the producer.

Link to this section Types

Link to this type

args() View Source
args() :: nonempty_improper_list(OffBroadway.MQTT.Config.t(), opts())

Type for the argument passed to the producer on start.

Type for optios that can be passed to the producer.

  • subscription - A tuple with the topic and QOS to subscribe to.

Any other option is passed to OffBroadway.MQTT.Client.start/4 as options. Refere there for further options.

Link to this type

opts() View Source
opts() :: [opt(), ...]

Collection type for options to start the producer with.

Link to this type

state() View Source
state() :: %{
  client_id: String.t(),
  config: OffBroadway.MQTT.Config.t(),
  demand: non_neg_integer(),
  dequeue_timer: nil | reference(),
  queue: GenServer.name()
}

Internal state of the producer.