DivoPulsar

A library implementing the Divo Stack behaviour, providing a pre-configured Pulsar broker via docker-compose for integration testing Elixir apps. The broker runs in standalone mode.

Requires inclusion of the Divo library in your mix project.

Installation

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

def deps do
  [
    {:divo, "~> 1.1.0"},
    {:divo_pulsar, "~> 0.1.0"}
  ]
end

Use

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

config :myapp,
  divo: [
    {DivoPulsar, [port: 8080]}
  ]

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

use Divo, services: [:pulsar]

The resulting stack will create a single Pulsar broker in standalone mode exposing the standard port 6650 for broker communication and port 8080 for the api.

Configuration

You may omit the configuration arguments to DivoPulsar and still have a working stack. The unmodified configuration will create the broker only and only expose the producer/consumer port.

See Divo GitHub or Divo Hex Documentation for more instructions on using and configuring the Divo library. See Pulsar Dockerhub for further documentation on using and configuring the features of the container image itself. See Pulsar source for the full codebase behind Pulsar

Health Check

Contrary to obvious wisdom, the health check for the service does not base itself on the return of the Pulsar Admin APIs /brokers/health endpoint. Through use of the tool, certain functionality of the cluster was found to still not be ready to receive client requests, such as trying to write to the default tenant/namespace. As a result, the health check has been rewritten to ensure the default tenant/namespace is ready to receive read and write requests before the container is judged to be ready as a standin for a fully-functional system.