emitter

command module
v2.0.73+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

README

Emitter: Clustered Publish-Subscribe Broker

Emitter is a free open source real-time messaging service that connects all devices. This publish-subscribe messaging API is built for speed and security.

Emitter is a real-time communication service for connecting online devices. Infrastructure and APIs for IoT, gaming, apps and real-time web. At its core, emitter.io is a distributed, scalable and fault-tolerant publish-subscribe messaging platform based on MQTT protocol and featuring message storage.

Emitter can be used for online gaming and mobile apps by satisfying the requirements for low latency, binary messaging and high throughput. It can also be used for the real-time web application such as dashboards or visual analytics or chat systems. Moreover, Emitter is perfect for the internet of things and allows sensors to be controlled and data gathered and analyzed.

Build status Twitter Follow

Server Quick Start

The quick way to start an Emitter broker is by using docker run command as shown below. Alternatively, you might compile this repository and use dotnet CLI or Visual Studio to rebuild and run from source.

docker run -d --name emitter -p 8080:8080 --privileged --restart=unless-stopped emitter/server

The command above starts a new server and if no configuration or environment variables were supplied, it will print out a message similar to the message below once the server has started:

Warning: New license: BjeUWk46tfTTL6ks5q-Vnyj-puoAAAAAAAAAAAAAAAI
Warning: New secret key: Hc4pyBAGEe6Z9PYy77AH0Y43dQm62faH
...
Listening: 127.0.0.1:8080
Listening: 127.0.0.1:8443
Listening: 127.0.0.1:4000

This message shows that a new security configuration was generated, you can then re-run EMITTER_LICENSE set to the specified value. Alternatively, you can set "license" property in the emitter.conf configuration file.

Finally, open a browser and navigate to http://127.0.0.1:8080/keygen in order to generate your key. Now you can use the secret key generated to create channel keys, which allow you to secure individual channels and start using emitter.

Sandbox

Emitter has a sandbox - a free cloud cluster which allows you to quickly try out the platform and see how simple it is to create connected, real-time applications. The movie below shows you how to create your sandbox account and create a simple hello-world application within 5 minutes.

Getting Started With Emitter

Usage Example

The code below shows a small example of usage of emitter with the Javascript SDK. As you can see, the API exposes straightforward methods such as publish and subscribe which can take binary payload and are secured through channel keys.

// connect to emitter service
var connection = emitter.connect({ host: '127.0.0.1' });

// once we're connected, subscribe to the 'chat' channel
emitter.on('connect', function(){
    emitter.subscribe({
        key: "<channel key>",
        channel: "chat"
    });
});

// publish a message to the chat channel
emitter.publish({
    key: "<channel key>",
    channel: "chat/my_name",
    message: "hello, emitter!"
});

Further documentation, demos and language/platform SDKs are available in the develop section of our website. Make sure to check out the getting started tutorial which explains the basic usage of emitter and MQTT.

Building

The server requires .NET Core platform to be installed. Once you have this installed, simply clone this repository and run the following commands to restore the Nuget packages and run the server.

dotnet restore
cd src/Emitter.Server
dotnet run

Alternatively, you can use Visual Studio IDE to build, run and debug. Simply open the Emitter.sln file provided.

Deploying as Docker Container

Docker Automated build Docker Pulls

Emitter is convinently packaged as a docker container. To run the emitter service on a single server, use the command below. Once the server is started, it will generate a new security configuration, you can then re-run the same command with an additional environment variable -e EMITTER_LICENSE set to the provided value.

docker run -d -p 8080:8080 emitter/server

For the clustered (multi-server) mode, the container can be started using the simple docker run with 3 main parameters.

docker run -d -p 8080:8080 -p 4000:4000 -e EMITTER_LICENSE=[key] -e EMITTER_CLUSTER_SEED=[seed] -e EMITTER_CLUSTER_KEY=[name] emitter/server

Support, Discussion, and Community

If you need any help with Emitter Server or any of our client SDKs, please join us at either our gitter chat where most of our team hangs out at or drop us an e-mail at info@emitter.io.

Please submit any Emitter bugs, issues, and feature requests to emitter-io>emitter. If there are any security issues, please email info@emitter.io instead of posting an open issue in Github.

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Licensing

Copyright (c) 2009-2016 Misakai Ltd. This project is licensed under Affero General Public License v3.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package logging is a package to speed up your logging.
Package logging is a package to speed up your logging.
network
tcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL