Home

Awesome

Phoenix.Pubsub.VerneMQ

Build Status

A VerneMQ PubSub adapter for the Phoenix framework.

This adapter was built for VerneMQ but should work with any MQTT server.

Configuration

In order to use the VerneMQ pubsub adapter in phoenix, add it and vmq_commons as a dendency to your mix.exs file:

defp deps do
  [{:vmq_commons, git: "https://github.com/erlio/vmq_commons.git", compile: "rebar compile"},
   {:phoenix_pubsub_vernemq, "~> 0.0.3"}],
end

Note that you need rebar installed in order to compile the vmq_commons dependency.

Then configure your endpoint appropriately:

config :my_app, MyApp.Endpoint,
  ...
  pubsub: [name: HelloPhoenix.PubSub,
           adapter: Phoenix.PubSub.VerneMQ,
           host: "localhost",
           port: 1883,
           client_id: "test_client"]

The complete list of configuration options:

Notes

This work was inspired by the Redis pubsub adapter for Phoenix.

The VerneMQ pubsub adapter is licensed under the Apache License Version 2.