/mqttfaas

Run functions on MQTT message

Primary LanguageGoApache License 2.0Apache-2.0

MQTT FAAS

Build Status Go Report Card

Execute functions that are run based on mqtt messages.

Quick Setup

Install the binary

curl https://raw.githubusercontent.com/sks/mqttfaas/master/install.sh | sh

On Docker

# Download latest docker-compose.yml
wget https://raw.githubusercontent.com/sks/mqttfaas/master/docker-compose.yml

# Download a sample Function.
# Samples can be found in samples directory
docker pull sabithksme/mqttfaas_gocat

# Start docker container
docker-compose up -d

# Grab a mqtt cli for testing purpose.
# I am using https://github.com/shirou/mqttcli
# go get github.com/shirou/mqttcli

export MQTT_HOST="localhost"

mqttcli sub -dd -t "cat/#"

mqttcli pub -t "cat/input/message" -m "this message should be echoed back to /cat/output"

Definition of functions

Samples can be found in samples folder

Guideline on labels can be found in here

Development environment

Checkout Makefile for all available commands

git clone github.com/sks/mqttfaas $GOPATH/src/github.com/sks/mqttfaas
cd $_

# Install Dependency and build binaries
make

make help