All Projects → hivemq → Hivemq Community Edition

hivemq / Hivemq Community Edition

Licence: apache-2.0
HiveMQ CE is a Java-based open source MQTT broker that fully supports MQTT 3.x and MQTT 5. It is the foundation of the HiveMQ Enterprise Connectivity and Messaging Platform

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Hivemq Community Edition

Emqx
An Open-Source, Cloud-Native, Distributed MQTT Message Broker for IoT.
Stars: ✭ 8,951 (+1492.7%)
Mutual labels:  mqtt, messaging, pubsub, broker, mqtt-broker, iot
Vernemq
A distributed MQTT message broker based on Erlang/OTP. Built for high quality & Industrial use cases.
Stars: ✭ 2,628 (+367.62%)
Mutual labels:  mqtt, messaging, pubsub, broker, iot
Ejabberd
Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
Stars: ✭ 5,077 (+803.38%)
Mutual labels:  mqtt, messaging, pubsub, broker, iot
Mqtt
MQTT broker written in D, using vibe.d
Stars: ✭ 59 (-89.5%)
Mutual labels:  mqtt, broker, mqtt-broker, iot
Mqttnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 2,486 (+342.35%)
Mutual labels:  mqtt, broker, mqtt-broker, iot
Thingsboard Gateway
Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
Stars: ✭ 796 (+41.64%)
Mutual labels:  mqtt, mqtt-broker, iot
Aedes
Barebone MQTT broker that can run on any stream server, the node way
Stars: ✭ 1,007 (+79.18%)
Mutual labels:  mqtt, mqtt-broker, iot
Mainflux
Industrial IoT Messaging and Device Management Platform
Stars: ✭ 1,341 (+138.61%)
Mutual labels:  mqtt, messaging, iot
Mqtt Pwn
MQTT-PWN intends to be a one-stop-shop for IoT Broker penetration-testing and security assessment operations.
Stars: ✭ 156 (-72.24%)
Mutual labels:  mqtt, mqtt-broker, iot
Tigase Server
Highly optimized, extremely modular and very flexible XMPP/Jabber server
Stars: ✭ 170 (-69.75%)
Mutual labels:  messaging, pubsub, iot
Crossbar
Crossbar.io - WAMP application router
Stars: ✭ 1,957 (+248.22%)
Mutual labels:  mqtt, messaging, broker
Enmasse
EnMasse - Self-service messaging on Kubernetes and OpenShift
Stars: ✭ 185 (-67.08%)
Mutual labels:  mqtt, messaging, broker
Volantmq
High-Performance MQTT Server
Stars: ✭ 785 (+39.68%)
Mutual labels:  mqtt, broker, iot
smartacus-mqtt-broker
smartacus-mqtt-broker is a Java-based open source MQTT broker that fully supports MQTT 3.x .Using Netty 4.1.37
Stars: ✭ 25 (-95.55%)
Mutual labels:  pubsub, mqtt-broker, broker
sol
Lightweight MQTT broker, written from scratch. IO is handled by a super simple event loop based upon the most common IO multiplexing implementations.
Stars: ✭ 72 (-87.19%)
Mutual labels:  mqtt, pubsub, mqtt-broker
Activemq Artemis
Mirror of Apache ActiveMQ Artemis
Stars: ✭ 685 (+21.89%)
Mutual labels:  mqtt, messaging, broker
Openremote
100% open-source IoT Platform - Integrate your assets, create rules, and visualize your data
Stars: ✭ 254 (-54.8%)
Mutual labels:  mqtt, mqtt-broker, iot
Emitter
High performance, distributed and low latency publish-subscribe platform.
Stars: ✭ 3,130 (+456.94%)
Mutual labels:  mqtt, pubsub, mqtt-broker
Mqtt Panel
A web interface for MQTT
Stars: ✭ 315 (-43.95%)
Mutual labels:  mqtt, mqtt-broker, iot
Mqtt Smarthome
Smart home automation with MQTT as the central message bus - Architectural proposal
Stars: ✭ 356 (-36.65%)
Mutual labels:  mqtt, iot

++++

++++

= HiveMQ Community Edition

image:https://maven-badges.herokuapp.com/maven-central/com.hivemq/hivemq-community-edition-embedded/badge.svg["Maven Central",link="https://maven-badges.herokuapp.com/maven-central/com.hivemq/hivemq-community-edition-embedded"] image:https://jitpack.io/v/hivemq/hivemq-community-edition.svg["JitPack", link="https://jitpack.io/#hivemq/hivemq-community-edition"] image:https://javadoc.io/badge2/com.hivemq/hivemq-community-edition-embedded/javadoc.svg["javadoc", link=https://javadoc.io/doc/com.hivemq/hivemq-community-edition-embedded] image:https://travis-ci.com/hivemq/hivemq-community-edition.svg?token=2JEoSXzFpviQH47MBPSm&branch=master["Build Status",link="https://travis-ci.com/hivemq/hivemq-community-edition"]

HiveMQ CE is a Java-based open source MQTT broker that fully supports MQTT 3.x and MQTT 5.

HiveMQ CE is the foundation of the HiveMQ enterprise-connectivity and messaging platform and implements all MQTT features. This project is the technical core of many large MQTT deployments and is now available as open source software under the Apache 2 license.

== Features

  • All MQTT 3.1, 3.1.1 and MQTT 5.0 features
  • MQTT over TCP, TLS, WebSocket and Secure WebSocket transport
  • Java Extension SDK for: ** Authentication ** Authorization ** Client Initializers ** MQTT Packet Interceptors ** Interacting with Publishes, Retained Messages, Clients and Subscriptions
  • Running on Windows, Linux and MacOS (Linux is recommended)
  • Embedded Mode

HiveMQ CE is compatible with all MQTT 3 and MQTT 5 clients, including Eclipse Paho and https://github.com/hivemq/hivemq-mqtt-client[HiveMQ MQTT Client].

== Documentation

The documentation for the HiveMQ CE can be found https://github.com/hivemq/hivemq-community-edition/wiki[here].

MQTT Resources

== HiveMQ Community Forum

The ideal place for questions or discussions about the HiveMQ Community Edition is our brand new https://community.hivemq.com/[HiveMQ Community Forum].

== How to Use

=== Quick Start

[source,bash]

cd hivemq-ce- ./bin/run.sh

You can now connect MQTT clients to <ip address>:1883.

[CAUTION] If you want to connect devices on external networks to HiveMQ CE, please make sure your server is reachable from those networks and the required ports (default: 1883) are accessible through your firewall.

=== Just in Time Builds

Just in time builds for current branches on this repository and for specific commits are available https://hivemq.github.io/nightly-builds/[here].

=== Run with Docker

All releases as well as the current state of the master branch are available in the https://hub.docker.com/r/hivemq/hivemq-ce[hivemq/hivemq-ce] repository on DockerHub. To execute this image, simply run the following command:

[source,bash]

docker run --name hivemq-ce -d -p 1883:1883 hivemq/hivemq-ce

To change the default log level you can set the environment variable HIVEMQ_LOG_LEVEL when running the container:

[source,bash]

docker run --name hivemq-ce -e HIVEMQ_LOG_LEVEL=INFO -d -p 1883:1883 hivemq/hivemq-ce

=== Building from Source

==== Prerequisites

At least Java version 11 is required to build and run HiveMQ CE.

If you are in doubt, you can check the installed Java version by entering java -version on your command line.

==== Building the Binary Package

Check out the git repository and build the binary package.

[source,bash]

git clone https://github.com/hivemq/hivemq-community-edition.git

cd hivemq-community-edition

./gradlew clean packaging

The package hivemq-ce-<version>.zip is created in the sub-folder build/zip/.

==== Building the Docker Image

Check out the git repository and build the Docker image.

[source,bash]

git clone https://github.com/hivemq/hivemq-community-edition.git

cd hivemq-community-edition

docker/build.sh

docker run hivemq/hivemq-ce

The Docker image hivemq/hivemq-ce is created locally.

You can tag the image or use the TARGET_IMAGE environment variable to manipulate the image name.

==== Start

Unzip the created binary package

[source,bash]

cd hivemq-ce-

./bin/run.sh

For further development instructions see the link:CONTRIBUTING.adoc[contribution guidelines].

=== Embedded Mode

HiveMQ Community Edition offers an embedded mode and a programmatic API for integrating with Java/Java EE software.

===== Gradle

If you use Gradle, include the following code in your build.gradle file.

[source,groovy]

dependencies { implementation 'com.hivemq:hivemq-community-edition-embedded:2021.1' }

===== Maven

If you use Maven, include the following code in your pom.xml file.

[source,xml]

... com.hivemq hivemq-community-edition-embedded 2021.1 ... ----

NOTE: You must set the compiler version to 11 or higher.

==== Usage

Entry into the embedded mode is done with the com.hivemq.embedded.EmbeddedHiveMQBuilder.

[source,java]

public class Main {

public static void main(String[] args) {

    final EmbeddedHiveMQBuilder embeddedHiveMQBuilder = EmbeddedHiveMQ.builder()
        .withConfigurationFolder(Path.of("/path/to/embedded-config-folder"))
        .withDataFolder(Path.of("/path/to/embedded-data-folder"))
        .withExtensionsFolder(Path.of("/path/to/embedded-extensions-folder"));
    ...
}

}

Once built, an EmbeddedHiveMQ can be started with start().

[source,java]

public class Main {

public static void main(String[] args) {
    final EmbeddedHiveMQBuilder embeddedHiveMQBuilder = EmbeddedHiveMQ.builder();
    ...

    try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {
        hiveMQ.start().join();
        ...
    } catch (final Exception ex) {
        ex.printStackTrace();
    }
}

}

A running EmbeddedHiveMQ can be stopped with stop().

[source,java]

public class Main {

public static void main(String[] args) {

    ...

    try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {
        ...
        hiveMQ.stop().join();
    } catch (final Exception ex) {
        ex.printStackTrace();
    }
}

}

Similar to the embedded HiveMQ an embedded extension can be built with the com.hivemq.embedded.EmbeddedExtensionBuilder.

Then add the embedded extension to the embedded HiveMQ builder.

[source,java]

public class Main {

public static void main(String[] args) {

    final EmbeddedExtension embeddedExtension = EmbeddedExtension.builder()
            .withId("embedded-ext-1")
            .withName("Embedded Extension")
            .withVersion("1.0.0")
            .withPriority(0)
            .withStartPriority(1000)
            .withAuthor("Me")
            .withExtensionMain(new MyEmbeddedExtensionMain())
            .build();

    final EmbeddedHiveMQBuilder builder = EmbeddedHiveMQ.builder()
            .withConfigurationFolder(Path.of("/path/to/embedded-config-folder"))
            .withDataFolder(Path.of("/path/to/embedded-data-folder"))
            .withExtensionsFolder(Path.of("/path/to/embedded-extensions-folder"))
            .withEmbeddedExtension(embeddedExtension);

    try (final EmbeddedHiveMQ hiveMQ = builder.build()) {
        hiveMQ.start().join();
        //do something with hivemq
    } catch (final Exception ex) {
        ex.printStackTrace();
    }
}

private static class MyEmbeddedExtensionMain implements ExtensionMain {

    @Override
    public void extensionStart(final @NotNull ExtensionStartInput extensionStartInput, final @NotNull ExtensionStartOutput extensionStartOutput) {
        // my extension start code
    }

    @Override
    public void extensionStop(final @NotNull ExtensionStopInput extensionStopInput, final @NotNull ExtensionStopOutput extensionStopOutput) {
        // my extension stop code
    }
}

}

NOTE: An EmbeddedHiveMQ is a resource that is similar to a e.g. network connection and implements the java.lang.AutoCloseable interface. Always use ARM (try with resources) or ensure a call to close().

==== Exclusions

When you deploy an application that includes EmbeddedHiveMQ, it can be useful to exclude some dependencies. One way to exclude dependencies is with the link:https://maven.apache.org/plugins/maven-shade-plugin/[maven shade plugin].

[source,xml]

... org.apache.maven.plugins maven-shade-plugin 3.2.1 package shade org.rocksdb:rocksdbjni ch.qos.logback:logback-classic *:* META-INF/*.SF META-INF/*.DSA META-INF/*.RSA ... ----

===== RocksDB Exclusion

To exclude the org.rocksdb:rocksdbjni dependency, two internal configurations must be changed before you call start().

[source,java]

public class Main {

public static void main(String[] args) {

    ...

    try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {

        InternalConfigurations.PAYLOAD_PERSISTENCE_TYPE.set(PersistenceType.FILE);
        InternalConfigurations.RETAINED_MESSAGE_PERSISTENCE_TYPE.set(PersistenceType.FILE);

        hiveMQ.start().join();

        ...
    } catch (final Exception ex) {
        ex.printStackTrace();
    }
}

}

== Contributing

If you want to contribute to HiveMQ CE, see the link:CONTRIBUTING.adoc[contribution guidelines].

== License

HiveMQ Community Edition is licensed under the APACHE LICENSE, VERSION 2.0. A copy of the license can be found link:LICENSE[here].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].