DivoVernemq

A library implementing the Divo Stack behaviour, providing a pre-configured VerneMQ broker via docker-compose for integration testing Elixir apps. The broker runs as a single-node "cluster".

Installation

The package can be installed by adding divo_vernemq to your list of dependencies in mix.exs:

def deps do
  [
    {:divo_vernemq, "~> 0.1.0"}
  ]
end

Use

In your Mix configuration file (i.e. config/integration.exs), include the following at minimum:

config :myapp,
  divo: [
    divo: [DivoVernemq]
  ],
  divo_wait: [dwell: 1_000, max_tries: 30]

In your integration test, specify that you want to use Divo:

use Divo, services: [:vernemq]

The resulting stack will create a single VerneMQ broker server exposing the standard port 1883 for MQTT, 8883 for MQTT over SSL, 8080 for MQTT over Websockets, and 8888 for the Prometheus metrics port (and status web UI).

Configuration

You may omit the configuration arguments to DivoVernemq and still have a working stack. The unmodified configuration will create the broker and expose the default ports as listed in the above example.

The following options are available for configuration:

See Divo Github or Divo Hex Documentation for more instructions on using and configuring the Divo library. See VerneMQ source for the full codebase behind VerneMQ.