GithubHelp home page GithubHelp logo

zofuthan / moquette Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moquette-io/moquette

0.0 0.0 0.0 1.63 MB

Java MQTT small broker

License: Apache License 2.0

Java 92.53% Shell 0.46% Groovy 6.96% Ruby 0.05%

moquette's Introduction

What is Moquette?

Moquette aims to be a MQTT compliant broker. The broker supports QoS 0, QoS 1 and QoS 2.

Its designed to be evented, uses Netty for the protocol encoding and decoding part, the protocol logic is essentially a single threaded and it's isolated from front connectors part by LMAX disruptor's ring buffer.

Who use it?

[Freedomotic] (http://www.freedomotic.com/) Is an home automation framework, uses Moquette embedded to interface with MQTT world. Part of moquette are also used into the [Vertx MQTT module] (https://github.com/giovibal/vertx-mqtt-broker-mod), into MQTT spy and into [WSO2 Messge broker] (http://techexplosives-pamod.blogspot.it/2014/05/mqtt-transport-architecture-wso2-mb-3x.html).

1 minute set up

Start play with it, download the self distribution tar from BinTray , the un untar and start the broker listening on 1883 port and enjoy!

tar zxf distribution-0.6-bundle-tar.tar.gz
cd bin
./moquette.sh

Running inside OSGi container

Starting from version 0.6 Moquette is OSGi compliant, to see it in action:

mvn clean install;
cd budle;
mvn install pax:provision

Embedding in other projects

To embed Moquette in another maven project is sufficient to include a repository and declare the dependency:

<repositories>
  <repository>
    <id>bintray</id>
    <url>http://dl.bintray.com/andsel/maven/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

Include dependency in your project:

<dependency>
      <groupId>org.dna.mqtt</groupId>
      <artifactId>moquette-broker</artifactId>
      <version>0.6</version>
</dependency>

Build from sources

After a git clone of the repository, cd into the cloned sources and: mvn clean package. In distribution/target directory will be produced the selfcontained tar for the broker with all dependencies and a running script.

SSL configuration

Here are some simple steps to do to configure Moquette to serve over SSL **Details ** Moquette uses JavaKeyStore? and certificates to handle SSL. In order to expose it over SSL you have create a keystore for the broker (select the password), exporting a certificate and define 4 variables into moquette.conf.

Create a keystore In a directory generate the keystore using the JRE's keytool:

keytool -keystore serverkeystore.jks -alias testserver -genkey -keyalg RSA

To make it work you have to answer at the first question, say moquette.dna.org and as password we could use passw0rdsrv for both (keystore and keymanger)

Export a certificate Then you need export a certificate:

keytool -export -alias testserver -keystore serverkeystore.jks -file testserver.crt

Imporing on the client side Supposing you have already created the keystore for the client side, (name it clientkeystore for example), we could import the certificate with:

keytool -keystore clientkeystore.jks -import -alias testserver -file testserver.crt -trustcacerts

It's done! We just need use the Paho client to connect to the server, check ServerIntegrationSSLTest.java integration test to see how.

moquette's People

Contributors

andsel 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.