Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larshesel/phoenix_pubsub_vernemq
OBSOLETE - A VerneMQ/MQTT pubsub adapter for the Phoenix framework
https://github.com/larshesel/phoenix_pubsub_vernemq
Last synced: 2 months ago
JSON representation
OBSOLETE - A VerneMQ/MQTT pubsub adapter for the Phoenix framework
- Host: GitHub
- URL: https://github.com/larshesel/phoenix_pubsub_vernemq
- Owner: larshesel
- License: apache-2.0
- Created: 2015-06-01T14:35:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-29T15:08:09.000Z (over 9 years ago)
- Last Synced: 2024-05-02T09:14:22.688Z (8 months ago)
- Language: Elixir
- Homepage:
- Size: 147 KB
- Stars: 25
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - The VerneMQ MQTT pubsub adapter for the Phoenix framework. (Framework Components)
- fucking-awesome-elixir - phoenix_pubsub_vernemq - The VerneMQ MQTT pubsub adapter for the Phoenix framework. (Framework Components)
- awesome-elixir - phoenix_pubsub_vernemq - The VerneMQ MQTT pubsub adapter for the Phoenix framework. (Framework Components)
README
## Phoenix.Pubsub.VerneMQ
[![Build Status](https://travis-ci.org/larshesel/phoenix_pubsub_vernemq.svg?branch=master)](https://travis-ci.org/larshesel/phoenix_pubsub_vernemq)
A VerneMQ PubSub adapter for the
[Phoenix framework](http://www.phoenixframework.org/).This adapter was built for [VerneMQ](https://verne.mq/) 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:```Elixir
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](https://github.com/basho/rebar) installed
in order to compile the `vmq_commons` dependency.Then configure your endpoint appropriately:
```Elixir
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](https://github.com/phoenixframework/phoenix_pubsub_redis)
for Phoenix.The VerneMQ pubsub adapter is licensed under the Apache License Version 2.