{"id":13487625,"url":"https://github.com/hivemq/hivemq-community-edition","last_synced_at":"2025-05-14T10:06:31.085Z","repository":{"id":37740765,"uuid":"178892772","full_name":"hivemq/hivemq-community-edition","owner":"hivemq","description":"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","archived":false,"fork":false,"pushed_at":"2025-05-10T01:56:26.000Z","size":12611,"stargazers_count":1113,"open_issues_count":34,"forks_count":271,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-05-10T02:44:45.742Z","etag":null,"topics":["broker","hivemq","iot","iot-middleware","java","m2m","messaging","mqtt","mqtt-broker","mqtt-protocol","mqtt-server","mqtt5","pubsub"],"latest_commit_sha":null,"homepage":"https://www.hivemq.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hivemq.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-01T15:29:54.000Z","updated_at":"2025-05-09T05:27:08.000Z","dependencies_parsed_at":"2024-01-05T13:53:09.060Z","dependency_job_id":"89a2d4d9-676e-4ed3-8b05-35b0fc22c307","html_url":"https://github.com/hivemq/hivemq-community-edition","commit_stats":{"total_commits":955,"total_committers":51,"mean_commits":"18.725490196078432","dds":0.7183246073298429,"last_synced_commit":"84c1fa3fe4e8b1ccb7840c65fa484445d25811d5"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivemq%2Fhivemq-community-edition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivemq%2Fhivemq-community-edition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivemq%2Fhivemq-community-edition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivemq%2Fhivemq-community-edition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hivemq","download_url":"https://codeload.github.com/hivemq/hivemq-community-edition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254119472,"owners_count":22017951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broker","hivemq","iot","iot-middleware","java","m2m","messaging","mqtt","mqtt-broker","mqtt-protocol","mqtt-server","mqtt5","pubsub"],"created_at":"2024-07-31T18:01:01.322Z","updated_at":"2025-05-14T10:06:31.077Z","avatar_url":"https://github.com/hivemq.png","language":"Java","funding_links":[],"categories":["IoT 平台","Java","Platform","Projects","物联网"],"sub_categories":["底层开发库","Android Things","Message Broker","文件同步"],"readme":"++++\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://www.hivemq.com/img/svg/hivemq-ce.svg\" width=\"500\"\u003e\n\u003c/p\u003e\n++++\n\n= HiveMQ Community Edition\n\nimage: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\"]\nimage:https://jitpack.io/v/hivemq/hivemq-community-edition.svg[\"JitPack\",link=\"https://jitpack.io/#hivemq/hivemq-community-edition\"]\nimage:https://javadoc.io/badge2/com.hivemq/hivemq-community-edition-embedded/javadoc.svg[\"javadoc\",link=https://javadoc.io/doc/com.hivemq/hivemq-community-edition-embedded]\nimage:https://img.shields.io/github/actions/workflow/status/hivemq/hivemq-community-edition/check.yml?branch=master[GitHub Workflow Status (with branch),link=https://github.com/hivemq/hivemq-community-edition/actions/workflows/check.yml?query=branch%3Amaster]\n\nHiveMQ CE is a Java-based open source MQTT broker that fully supports MQTT 3.x and MQTT 5.\n\nHiveMQ CE is the foundation of the HiveMQ enterprise-connectivity and messaging platform and implements all MQTT features.\nThis project is the technical core of many large MQTT deployments and is now available as open source software under the Apache 2 license.\n\n* Website: https://www.hivemq.com/\n* Documentation: https://github.com/hivemq/hivemq-community-edition/wiki\n* Community Forum: https://community.hivemq.com/\n* Contribution guidelines: link:CONTRIBUTING.adoc[Contributing.adoc]\n* License: The source files in this repository are made available under the link:LICENSE[Apache License Version 2.0].\n\n== Features\n\n* All MQTT 3.1, 3.1.1 and MQTT 5.0 features\n* MQTT over TCP, TLS, WebSocket and Secure WebSocket transport\n* Java Extension SDK for:\n** Authentication\n** Authorization\n** Client Initializers\n** MQTT Packet Interceptors\n** Interacting with Publishes, Retained Messages, Clients and Subscriptions\n* Running on Windows, Linux and MacOS (Linux is recommended)\n* Embedded Mode\n\nHiveMQ 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].\n\n== Documentation\n\nThe documentation for the HiveMQ CE can be found https://github.com/hivemq/hivemq-community-edition/wiki[here].\n\nMQTT Resources\n\n* https://www.hivemq.com/mqtt-essentials/[MQTT Essentials]\n* https://www.hivemq.com/mqtt-5/[MQTT 5 Essentials]\n\n== HiveMQ Community Forum\n\nThe ideal place for questions or discussions about the HiveMQ Community Edition is our brand new https://community.hivemq.com/[HiveMQ Community Forum].\n\n== How to Use\n\n=== Quick Start\n\n* Download the latest https://github.com/hivemq/hivemq-community-edition/releases/download/2025.3/hivemq-ce-2025.3.zip[HiveMQ CE binary package].\n* Unzip the package.\n* Run the run.sh (Linux/OSX) or run.bat (Windows) in the bin folder of the package.\n\n[source,bash]\n----\ncd hivemq-ce-\u003cversion\u003e\nbin/run.sh\n----\n\n[IMPORTANT]\nAt least Java version 11 is required to run HiveMQ CE.\nIf you are in doubt, you can check the installed Java version by entering `java -version` on your command line.\n\nYou can now connect MQTT clients to `\u003cip address\u003e:1883`.\n\n[CAUTION]\nIf 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.\n\n=== Just in Time Builds\n\nJust in time builds for current branches on this repository and for specific commits are available https://hivemq.github.io/nightly-builds/[here].\n\n=== Run with Docker\n\nAll 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.\nTo execute this image, simply run the following command:\n\n[source,bash]\n----\ndocker run --name hivemq-ce -d -p 1883:1883 hivemq/hivemq-ce\n----\n\nTo change the default log level you can set the environment variable `HIVEMQ_LOG_LEVEL` when running the container:\n\n[source,bash]\n----\ndocker run --name hivemq-ce -e HIVEMQ_LOG_LEVEL=INFO -d -p 1883:1883 hivemq/hivemq-ce\n----\n\n=== Building from Source\n\n==== Building the Binary Package\n\nCheck out the git repository and build the binary package.\n\n[source,bash]\n----\ngit clone https://github.com/hivemq/hivemq-community-edition.git\n\ncd hivemq-community-edition\n\n./gradlew hivemqZip\n----\n\nThe package `hivemq-ce-\u003cversion\u003e.zip` is created in the sub-folder `build/distributions/`.\n\n==== Building the Docker Image\n\nCheck out the git repository and build the Docker image.\n\n[source,bash]\n----\ngit clone https://github.com/hivemq/hivemq-community-edition.git\n\ncd hivemq-community-edition\n\n./gradlew loadOciImage\n----\n\nThe Docker image `hivemq/hivemq-ce:snapshot` is created locally.\n\nFor further development instructions see the link:CONTRIBUTING.adoc[contribution guidelines].\n\n=== Embedded Mode\n\nHiveMQ Community Edition offers an embedded mode and a programmatic API for integrating with Java/Java EE software.\n\n==== Gradle\n\nIf you use Gradle, include the following code in your `build.gradle(.kts)` file.\n\n[source,groovy]\n----\n\ndependencies {\n    implementation(\"com.hivemq:hivemq-community-edition-embedded:2025.3\")\n}\n----\n\n==== Maven\n\nIf you use Maven, include the following code in your `pom.xml` file.\n\n[source,xml]\n----\n\u003cproject\u003e\n    ...\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.hivemq\u003c/groupId\u003e\n            \u003cartifactId\u003ehivemq-community-edition-embedded\u003c/artifactId\u003e\n            \u003cversion\u003e2025.3\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n    ...\n\u003c/project\u003e\n----\n\nNOTE: You must set the compiler version to `11` or higher.\n\n==== Usage\n\nEntry into the embedded mode is done with the `com.hivemq.embedded.EmbeddedHiveMQBuilder`.\n\n[source,java]\n----\npublic class Main {\n\n    public static void main(String[] args) {\n\n        final EmbeddedHiveMQBuilder embeddedHiveMQBuilder = EmbeddedHiveMQ.builder()\n            .withConfigurationFolder(Path.of(\"/path/to/embedded-config-folder\"))\n            .withDataFolder(Path.of(\"/path/to/embedded-data-folder\"))\n            .withExtensionsFolder(Path.of(\"/path/to/embedded-extensions-folder\"));\n        ...\n    }\n}\n----\n\nOnce built, an EmbeddedHiveMQ can be started with `start()`.\n\n[source,java]\n----\npublic class Main {\n\n    public static void main(String[] args) {\n        final EmbeddedHiveMQBuilder embeddedHiveMQBuilder = EmbeddedHiveMQ.builder();\n        ...\n\n        try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {\n            hiveMQ.start().join();\n            ...\n        } catch (final Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n}\n----\n\nA running EmbeddedHiveMQ can be stopped with `stop()`.\n\n[source,java]\n----\npublic class Main {\n\n    public static void main(String[] args) {\n\n        ...\n\n        try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {\n            ...\n            hiveMQ.stop().join();\n        } catch (final Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n}\n----\n\nSimilar to the embedded HiveMQ an embedded extension can be built with the `com.hivemq.embedded.EmbeddedExtensionBuilder`.\n\nThen add the embedded extension to the embedded HiveMQ builder.\n\n[source,java]\n----\npublic class Main {\n\n    public static void main(String[] args) {\n\n        final EmbeddedExtension embeddedExtension = EmbeddedExtension.builder()\n                .withId(\"embedded-ext-1\")\n                .withName(\"Embedded Extension\")\n                .withVersion(\"1.0.0\")\n                .withPriority(0)\n                .withStartPriority(1000)\n                .withAuthor(\"Me\")\n                .withExtensionMain(new MyEmbeddedExtensionMain())\n                .build();\n\n        final EmbeddedHiveMQBuilder builder = EmbeddedHiveMQ.builder()\n                .withConfigurationFolder(Path.of(\"/path/to/embedded-config-folder\"))\n                .withDataFolder(Path.of(\"/path/to/embedded-data-folder\"))\n                .withExtensionsFolder(Path.of(\"/path/to/embedded-extensions-folder\"))\n                .withEmbeddedExtension(embeddedExtension);\n\n        try (final EmbeddedHiveMQ hiveMQ = builder.build()) {\n            hiveMQ.start().join();\n            //do something with hivemq\n        } catch (final Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n\n    private static class MyEmbeddedExtensionMain implements ExtensionMain {\n\n        @Override\n        public void extensionStart(final @NotNull ExtensionStartInput extensionStartInput, final @NotNull ExtensionStartOutput extensionStartOutput) {\n            // my extension start code\n        }\n\n        @Override\n        public void extensionStop(final @NotNull ExtensionStopInput extensionStopInput, final @NotNull ExtensionStopOutput extensionStopOutput) {\n            // my extension stop code\n        }\n    }\n}\n----\n\nNOTE: An EmbeddedHiveMQ is a resource that is similar to a e.g. network connection and implements the `java.lang.AutoCloseable` interface.\nAlways use ARM (_try with resources_) or ensure a call to `close()`.\n\n==== Exclusions\n\nWhen you deploy an application that includes EmbeddedHiveMQ, it can be useful to exclude some dependencies.\nOne way to exclude dependencies is with the  link:https://maven.apache.org/plugins/maven-shade-plugin/[maven shade plugin].\n\n[source,xml]\n----\n\u003cproject\u003e\n...\n \u003cbuild\u003e\n        \u003cplugins\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e3.2.1\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cphase\u003epackage\u003c/phase\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003eshade\u003c/goal\u003e\n                        \u003c/goals\u003e\n                        \u003cconfiguration\u003e\n                            \u003cartifactSet\u003e\n                                \u003cexcludes\u003e\n                                    \u003c!--Exclude the undesired dependencies--\u003e\n                                    \u003cexclude\u003eorg.rocksdb:rocksdbjni\u003c/exclude\u003e\n                                    \u003cexclude\u003ech.qos.logback:logback-classic\u003c/exclude\u003e\n                                \u003c/excludes\u003e\n                            \u003c/artifactSet\u003e\n                            \u003cfilters\u003e\n                                \u003cfilter\u003e\n                                    \u003cartifact\u003e*:*\u003c/artifact\u003e\n                                    \u003cexcludes\u003e\n                                        \u003cexclude\u003eMETA-INF/*.SF\u003c/exclude\u003e\n                                        \u003cexclude\u003eMETA-INF/*.DSA\u003c/exclude\u003e\n                                        \u003cexclude\u003eMETA-INF/*.RSA\u003c/exclude\u003e\n                                    \u003c/excludes\u003e\n                                \u003c/filter\u003e\n                            \u003c/filters\u003e\n                        \u003c/configuration\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n    \u003c/build\u003e\n...\n\u003c/project\u003e\n----\n\n===== RocksDB Exclusion\n\nTo exclude the `org.rocksdb:rocksdbjni` dependency, two internal configurations must be changed before you call `start()`.\n\n[source,java]\n----\npublic class Main {\n\n    public static void main(String[] args) {\n\n        ...\n\n        try (final EmbeddedHiveMQ hiveMQ = embeddedHiveMQBuilder.build()) {\n\n            InternalConfigurations.PAYLOAD_PERSISTENCE_TYPE.set(PersistenceType.FILE);\n            InternalConfigurations.RETAINED_MESSAGE_PERSISTENCE_TYPE.set(PersistenceType.FILE);\n\n            hiveMQ.start().join();\n\n            ...\n        } catch (final Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n}\n----\n\n== Contributing\n\nIf you want to contribute to HiveMQ CE, see the link:CONTRIBUTING.adoc[contribution guidelines].\n\n== License\n\nHiveMQ Community Edition is licensed under the `APACHE LICENSE, VERSION 2.0`.\nA copy of the license can be found link:LICENSE[here].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivemq%2Fhivemq-community-edition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhivemq%2Fhivemq-community-edition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivemq%2Fhivemq-community-edition/lists"}