Skip to content
A VerneMQ/MQTT pubsub adapter for the Phoenix framework
Elixir
Latest commit 3e87346 Jun 29, 2015 @larshesel v0.0.3
Failed to load latest commit information.
config Initial commit Jun 1, 2015
lib Clean up configuration options Jun 8, 2015
test Add pubsub tests from phoenix Jun 1, 2015
.gitignore Initial commit Jun 1, 2015
.travis.yml Install vernemq as a dependency Jun 8, 2015
LICENSE.txt Initial commit Jun 1, 2015
README.md v0.0.3 Jun 29, 2015
mix.exs v0.0.3 Jun 29, 2015

README.md

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:

  • :host - The MQTT server hostname or ip, default: "localhost"
  • :port - The MQTT server port number, default: 1883
  • :username - MQTT user name
  • :password - MQTT password
  • :client_id - MQTT client id, default: "phoenix_vernemq"
  • :publish_qos - QoS level for publishing, default: 0
  • :subscribe_qos - QoS level for subscribing, default: 0
  • :clean_session - default: true
  • :reconnect_timeout - default in seconds: 5
  • :keepalive_interval - defaults: 60

Notes

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

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

Something went wrong with that request. Please try again.