bondy-io / bondy

Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering service and event mesh capabilities combined. Bondy implements the open Web Application Messaging Protocol (WAMP) and is written in Erlang.
https://www.bondy.io
Apache License 2.0
129 stars 12 forks source link
api-gateway application-router distributed-systems erlang event-mesh iot microservices open-source publish-subscribe rest-api router rpc service-discovery service-mesh tcp-socket wamp wamp-protocol wamp-router websocket

Bondy logo

Version
Docker Pulls Docker Build (master) Docker Build (develop) Docker Build (latest-tag)
Architectures

Bondy

The distributed application networking platform

Bondy is an open source, always-on and scalable application networking platform connecting all elements of a distributed application—offering service and event mesh capabilities combined.

From web and mobile apps to IoT devices and backend microservices, Bondy allows everything to talk using one simple and secured communication protocol in a decoupled and dynamic way.

Bondy implements the open Web Application Messaging Protocol (WAMP).



drawing



Documentation

For our work-in-progress documentation for v1.0.0 go to https://developer.bondy.io.

Supported WAMP features

Authentication

In addition Bondy provides:

Advanced RPC features

Advanced Pub/Sub features

Transport

Transport Serialization

How is Bondy different than other WAMP routers?

Bondy provides a unique combination of features which sets it apart from other application networking solutions and WAMP routers in terms of scalability, reliability, high-performance, development and operational simplicity.

Quick Start

Docker

The fastest way to get started is by using our official docker images.

  1. Make sure you have Docker installed and running.
  2. Download the examples/custom_config folder to a location of your choice, then cd to that location and run the following command (If you already cloned the Bondy repository then just cd to the location of the repo).
docker run \
--rm \
-e BONDY_ERL_NODENAME=bondy1@127.0.0.1 \
-e BONDY_ERL_DISTRIBUTED_COOKIE=bondy \
-u 0:1000 \
-p 18080:18080 \
-p 18081:18081 \
-p 18082:18082 \
-p 18083:18083 \
-p 18084:18084 \
-p 18085:18085 \
-v "$(PWD)/examples/custom_config/etc:/bondy/etc" \
-v "/tmp/data:/bondy/data" \
leapsight/bondy:master

Building from source

Requirements

Building

Clone this repository and cd to the location where you cloned it.

To generate a Bondy release to be used in production execute the following command which will generate a tarball containing the release at $(PWD)/_build/prod/rel/.

make release

Untar and copy the resulting tarball to the location where you want to install Bondy e.g. ~/tmp/bondy.

tar -zxvf _build/prod/rel/bondy-1.0.0-rc.26.tar.qz -C ~/tmp/bondy

Running

To run Bondy, cd to the location where you installed it e.g. ~/tmp/bondy and run the following command which will print all the options.

bin/bondy

For example, to run Bondy with output to stdout do

bin/bondy foreground

And to run Bondy with an interactive Erlang shell do

bin/bondy console

Local cluster testing

Run a first node

We will start a node named bondy1@127.0.0.1 which uses the following variables from the config file (config/test/node_1_vars.config).

Transport Description Port
HTTP REST API GATEWAY 18080
HTTP REST API GATEWAY 18083
HTTP REST Admin API 18081
HTTPS REST Admin API 18084
Websockets WAMP 18080
TCP WAMP Raw Socket 18082
TLS WAMP Raw Socket 18085
make node1

Create a Realm

WAMP is a session-based protocol. Each session belongs to a Realm.

curl -X "POST" "http://localhost:18081/realms/" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -H 'Accept: application/json; charset=utf-8' \
     -d $'{
  "uri": "com.myrealm",
  "description": "My First Realm"
}'

Disable Security

We will disable security to avoid setting up credentials at this moment.

curl -X "DELETE" "http://localhost:18081/realms/com.myrealm/security_enabled" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -H 'Accept: application/json; charset=utf-8'

Run a second node

We start a second node named bondy2@127.0.0.1 which uses the following variables from the config file (config/test/node_2_vars.config).

Transport Description Port
HTTP REST API GATEWAY 18180
HTTP REST API GATEWAY 18183
HTTP REST Admin API 18181
HTTPS REST Admin API 18184
Websockets WAMP 18180
TCP WAMP Raw Socket 18182
TLS WAMP Raw Socket 18185
make node2

After a minute the two nodes will automatically connect. From now on all new Bondy control plane state changes will be propagated in real-time through broadcasting. One minute after joining the cluster, the Active Anti-entropy service will trigger an exchange after which the Realm we have created in bondy1@127.0.0.1 will have been replicated to bondy2@127.0.0.1.

Run a third node

make node3

Resources


Copyright by Leapsight, material licensed under the CC-BY-SA 4.0, provided as-is without any warranties, Bondy documentation (https://developer.bondy.io).