This repository is part of the Flogo Demo by Square IT Services.
- This Flogo application manages the interactions with end-users (which smiley to display?, the list of smileys, ...)
- Another Flogo application is used to manage the screen display part.
These two applications can communicate through a REST service or via an MQTT broker.
This application has a flow triggered indistinctly by a REST or MQTT trigger which take as a parameter the Unicode identifier of any emoji defined in the OpenMoji library.
It can be compiled and run on any system where Go program can be compiled to.
As any flow-based Flogo application, it can be modified with the Flogo Web UI.
- clone this repository
git clone https://github.com/square-it/flogo-demo-services.git
cd flogo-demo-services
- compile the application into a native executable
flogo ensure
flogo build -e
- launch a Mosquitto MQTT broker (required):
docker run --name mosquitto -d -p 1883:1883 -p 9001:9001 eclipse-mosquitto
- to enable OpenTracing, run a Zipkin collector (optional):
docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin
For detailed instructions read OpenTracing collectors for Flogo.
Considering this application will run on a host reachable at 192.168.1.1 with a Raspberry Pi reachable at 192.168.1.2
- define Raspberry Pi and MQTT configuration
export RPI_HOST=192.168.1.2
export RPI_PORT=4445
export MQTT_BROKER=192.168.1.1:1883
export MQTT_DEMO=demo
- run the executable
cd bin
./flogo-demo-services
To enable OpenTracing with a Zipkin HTTP collector listening on 192.168.1.1:9411, run instead
export FLOGO_OPENTRACING_IMPLEMENTATION=zipkin
export FLOGO_OPENTRACING_TRANSPORT=http
export FLOGO_OPENTRACING_ENDPOINTS=http://192.168.1.1:9411/api/v1/spans
cd bin
./flogo-demo-services
- test with a sample smiley
a. with the REST trigger
curl http://192.168.1.1:4445/v1/smiley/1F605
b. with a MQTT message
docker run -it --rm --name mqtt-publisher efrecon/mqtt-client pub -h 192.168.1.1 -t "demo" -m "1F609"
- run a Flogo Web UI
docker run --name flogo -it -d -p 3303:3303 -e FLOGO_NO_ENGINE_RECREATION=false flogo/flogo-docker:v0.5.8 eula-accept
- install custom-made activities contributions
docker exec -it flogo sh -c 'cd /tmp/flogo-web/build/server/local/engines/flogo-web && flogo install github.com/square-it/flogo-contrib-activities/command'
docker exec -it flogo sh -c 'cd /tmp/flogo-web/build/server/local/engines/flogo-web && flogo install github.com/square-it/flogo-contrib-activities/copyfile'
- restart the Flogo Web UI container
docker restart flogo
The Flogo Web UI is available at http://localhost:3303
.
Import the application using the provided flogo.json.