GithubHelp home page GithubHelp logo

mmagr / flowbroker-dojot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 28.0 2.03 MB

Flow processing implementation, with hot deployment capabilities

License: GNU General Public License v3.0

JavaScript 65.81% HTML 33.87% Shell 0.32%

flowbroker-dojot's Introduction

Mashup invoker proof of concept

This repository contains the implementation for a replacement for dojot's flow/mashup processor, based on nodes that run as persistent services on the platform.

The idea here is to run each known processing node (switch, change, geo, email, etc) as a container (or set of containers) and have the mashup orchestrator invoke a stateless endpoint on such containers, chaining their responses to produce the final flow results.

Implementation

  • The orchestrator itself is implemented under the directory orchestrator.
  • The library that abstracts communication from the orchestrator to the nodes themselves (e.g. change, email) is implemented under lib
  • A sample node implementation is found under sampleNode.

This code has been developed and tested using node v8.9.x

How to build (orchestrator)

cd orchestrator
npm install

Running

node index.js [options]

To run as a server:

node index.js -s

To run a message against a flow (sample):

node index.js -v -m '{"temperature": 22.5}' -d '18a9' -f flow.json -i 1000

This allows a processing node developer to easily test a node when used alongside the broker. For a sample flow definition file, check docs/samples/flow.json.

All the commands above will require at least a running, reachable instance of RabbitMQ at the hostname amqp.

To quickly create an environment using docker-compose, one may use the compose file (compose.yaml). For now, remember that any installed nodes must be added manually to the compose file or else the orchestrator will not be able to reach them. (developers) To allow quick prototyping and validation of the flow broker, a raw node:8 container is used, with the project's homedir mounted into it.

# -- on host --
docker-compose -p flows -f compose.yaml up -d

# spawn flowbroker within the same network
docker run --rm -it --network flows_default -v $PWD:/flowbroker node:8 bash

# -- now, within the container --
cd /flowbroker/orchestrator
npm install
node index.js -v -m '{"temperature": 22.5}' -d '18a9' -f ../docs/samples/flow.json -i 1000

flowbroker-dojot's People

Contributors

giovannicuriel avatar mmagr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.