Crossbar.io is an open source networking platform for distributed and microservice applications. It implements the open Web Application Messaging Protocol (WAMP), is feature rich, scalable, robust and secure. Let Crossbar.io take care of the hard parts of messaging so you can focus on your app's features.

Networking for Microservices

Distributed apps and microservices are a challenge.

A recurring issue is having seamless, scalable and secure communication between the distributed parts.

Crossbar.io is an open source application networking platform that solves the communication challenges.

Using the open Web Application Messaging Protocol (WAMP), it offers both Publish and Subscribe (PubSub) and routed Remote Procedure Calls (rRPC).

There are currently open-source WAMP client libraries for 14 languages.

Create powerful applications from loosely coupled components and microservices. All components talk to each other in real-time and as equal peers, across devices, networks and programming languages.

Crossbar.io takes care of the communications plumbing so that you can focus on solving new problems.


Multi-Protocol Integration

crossbar.io router connects several WAMP components, a REST endpoint and a MQTT client

Benefit from the features of WAMP while integrating with existing services and infrastructure.

REST bridging - Configure mappings between REST messages and WAMP messages.
Covers all four WAMP interactions: Call REST services via WAMP, trigger procedures on WAMP clients via REST calls, publish based on REST calls and send REST calls based on events.

MQTT broker - Full MQTT broker as a replacement for your existing broker.
Automatic mapping of MQTT to WAMP topics. WAMP publishes are received by MQTT subscribers and vice versa.

Powering the Internet-of-Things

Crossbar.io is powering Internet-of-things applications. Here is an illustration of how Crossbar.io connects devices, systems and people:

Steps

  • 00. Clients connect to Crossbar.io
  • 01. Clients subscribe to "temperature"
  • 02. Fan registers "start/stop fan"
  • 03. Motor temperature rises.
  • 04. Sensor publishes "temperature"
  • 05. "temperature" event dispatched
  • 06. Backend calls "start/stop fan"
  • 07. "start/stop fan" invoked
  • 08. Motor temperature falls.
  • 09. Sensor publishes "temperature"
  • 10. "temperature" event dispatched
  • 11. Backend calls "start/stop fan"
  • 12. "start/stop fan" invoked

How it works

Features

timeline
Connections at scale

A single Crossbar.io instance can handle 100s of thousands of concurrent connections, and 10s of thousands of messages per second. A multi-router scale-out architecture is under development.

fingerprint
Authentication & Authorization

Crossbario offers integrated authentication and fine-grained, role-based authorization. For more flexibility you can add custom authenticators or authorizers, giving you full control and enabling integration with your existing systems.

sync
REST bridging

Using the REST bridge services, applications can integrate REST services. Call a REST procedure or publish to a REST endpoint from WAMP. Call a WAMP procedure or publish from REST. Benefit from WAMP without discarding existing code.

open_with
MQTT broker

Full MQTT broker, with automatic mapping of WAMP topics to MQTT and vice versa. Extend an existing, MQTT-based application with WAMP capabilities and seamlessly integrate WAMP PubSub and MQTT.

cloud_queue
Component hosting

Run and monitor application components from Crossbar.io, using any runtime available on your system. Spining up your entire application backend can be as simple as 'crossbar start'.

share
Open Source

Crossbar.io is open source (AGPL v3). You're free to experiment, test and modify as you want - contributions to the project are welcome. For production deployments, there is commercial support by Crossbar.io's core developers.

people
Open Ecosystem

WAMP, the protocol that Crossbar.io uses, is an open protocol, with 26 client and 13 router implementations. Crossbar.io is written by the main creators of WAMP, and is the most feature-rich and performant WAMP router.

devices_other
Call into the browser

Components running in the browser are equal to other components. You can register procedures and call them from anywhere. Run code in the browser or in Node.js as best fits the situation.

Real-time Messaging

The cursors in the areas below are synchronized via a Crossbar.io instance running in the cloud:

Crossbar.io icon
Crossbar.io icon

Crossbar.io icon
Status: not connected.

Show me some code!

There are client libraries for 14 languages. Here is what application components look like in some languages.

// 1) SUBSCRIBE to a topic to receive events
function onhello(args) {
   console.log("Got event:", args[0]);
}
session.subscribe('com.myapp.hello', onhello);

// 2) PUBLISH an event
session.publish('com.myapp.hello', ['Hello, world!']);

// 3) REGISTER a procedure for remote calling
function add2(args) {
   return args[0] + args[1];
}
session.register('com.myapp.add2', add2);

// 4) CALL a remote procedure
session.call('com.myapp.add2', [2, 3]).then(
   function (result) {
      console.log("Got result:", result);
   }
);
# 1) SUBSCRIBE to a topic to receive events
def onhello(msg):
   print("Got event: {}".format(msg))
session.subscribe(onhello, 'com.myapp.hello')

# 2) PUBLISH an event
session.publish('com.myapp.hello', 'Hello, world!')

# 3) REGISTER a procedure for remote calling
def add2(x, y):
   return x + y
session.register(add2, 'com.myapp.add2');

# 4) CALL a remote procedure
result = yield from session.call('com.myapp.add2', 2, 3)
print("Got result: {}".format(result))
// 1) SUBSCRIBE to a topic to receive events
void onhello(const anyvec& args, const anymap& kwargs) {
   cout << "Got event: " << any_cast<string>(args[0]) << endl;   
}
session.subscribe("com.myapp.hello", &onhello);

// 2) PUBLISH an event
session.publish("com.myapp.hello", {string("Hello, world!")});

// 3) REGISTER a procedure for remote calling
any add2(const anyvec& args, const anymap& kwargs) {
   return any_cast<uint64_t>(args[0]) + any_cast<uint64_t>(args[1]);
}
session.provide("com.myapp.add2", &add2);

// 4) CALL a remote procedure
session.call("com.mathservice.add2", {2, 3}).then(
   [&](future<any> f) {
      cout << "Got result: " << any_cast<uint64_t> (f.get()) << endl;
   }
);
<?php
// 1) SUBSCRIBE to a topic to receive events
$onHello = function ($args) {
   echo "Got event: {$args[0]}\n";
};
$session->subscribe('com.myapp.hello', $onHello);

// 2) PUBLISH an event
$session->publish('com.example.oncounter', array('Hello, world!'));

// 3) REGISTER a procedure for remote calling
$add2 = function ($args) {
   return $args[0] + $args[1];
};
$session->register('com.myapp.add2', $add2);

// 4) CALL a remote procedure
$session->call('com.myapp.add2', array(2, 3))->then(
   function ($res) {
      echo "Got result: {$res}\n";
   }
);
/?>

Live Demos

Crossbar.io is great for building distributed, real-time enabled applications for Mobile, Web and Internet-of-Things. To give you a taste, here are a couple of live demos: