本项目是一款开源的边缘端MQTT服务器,基于JDK21+GraalVM 构建可直接行的的二进制文件,项目启动内存仅需20MB,毫米级的启动速度,让你的服务器空闲起来吧!
一款高性、高吞吐量、高扩展性的物联网mqtt集群broker!支持千万级+链接,同时支持自定义扩展功能,功能非常强大!推荐使用升级版:https://gitee.com/quickmsg/smqttx 项目!
感谢大家帮忙给新项目点Star,感谢!
SMQTT基于reactor-netty(spring-webflux底层依赖) 开发,底层采用Reactor3反应堆模型,支持单机部署,支持容器化部署,具备低延迟,高吞吐量,支持百万TCP连接,同时支持多种协议交互,是一款非常优秀的消息中间件!
![]()
消息质量等级实现(支持qos0,qos1,qos2)
topicFilter支持
会话消息
保留消息
遗嘱消息
设备掉线时候触发
客户端认证
tls加密
websocket协议支持x
使用mqtt over websocket
http协议交互
SPI接口扩展支持
集群支持(gossip协议实现)
容器化支持
默认镜像最新tag: 1ssqq1lxr/smqtt
持久化支持(session 保留消息)
规则引擎支持
支持springboot starter启动
管理后台
请参考smqtt文档如何启动管理后台
grafana监控集成
ACL权限管理
认证模块
大家不要恶意链接,谢谢!
| 管理 | 说明 | 其他 | 
|---|---|---|
| 121.40.92.152:1883 | mqtt端口 | 用户名:smqtt 密码:smqtt | 
| 121.40.92.152:18888 | mqtt over websocket | 用户名:smqtt 密码:smqtt | 
| http://121.40.92.152:60000/smqtt/admin | 管理后台 | 用户名:smqtt 密码:smqtt | 
引入依赖
<!--smqtt依赖 -->
<dependency>
  <groupId>io.github.quickmsg</groupId>
  <artifactId>smqtt-core</artifactId>
  <version>${Latest version}</version>
</dependency>
<!--集群依赖 -->
<dependency>
   <artifactId>smqtt-registry-scube</artifactId>
   <groupId>io.github.quickmsg</groupId>
   <version>${Latest version}</version>
</dependency>
<!--管理ui依赖 -->
<dependency>
   <artifactId>smqtt-ui</artifactId>
   <groupId>io.github.quickmsg</groupId>
   <version>${Latest version}</version>
</dependency>
        Bootstrap.builder()
                .rootLevel(Level.INFO)
                .websocketConfig(
                        BootstrapConfig.WebsocketConfig
                                .builder()
                                .enable(false)
                                .path("/mqtt")
                                .port(8888)
                                .build()
                )
                .tcpConfig(
                        BootstrapConfig
                                .TcpConfig
                                .builder()
                                .port(1883)
                                .ssl(SslContext.builder().enable(false).build())
                                .build())
                .httpConfig(
                        BootstrapConfig
                                .HttpConfig
                                .builder()
                                .enable(false)
                                .accessLog(true)
                                .admin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
                                .build())
                .clusterConfig(
                        BootstrapConfig.
                                ClusterConfig
                                .builder()
                                .enable(false)
                                .namespace("smqtt")
                                .node("node-1")
                                .port(7773)
                                .url("127.0.0.1:7771,127.0.0.1:7772").
                                build())
                .build()
                .startAwait();
    Bootstrap bootstrap = Bootstrap.builder()
                .rootLevel(Level.INFO)
                .websocketConfig(
                        BootstrapConfig.WebsocketConfig
                                .builder()
                                .enable(false)
                                .path("/mqtt")
                                .port(8888)
                                .build()
                )
                .tcpConfig(
                        BootstrapConfig
                                .TcpConfig
                                .builder()
                                .port(1883)
                                .ssl(SslContext.builder().enable(false).build())
                                .build())
                .httpConfig(
                        BootstrapConfig
                                .HttpConfig
                                .builder()
                                .enable(false)
                                .accessLog(true)
                                .admin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
                                .build())
                .clusterConfig(
                        BootstrapConfig.
                                ClusterConfig
                                .builder()
                                .enable(false)
                                .namespace("smqtt")
                                .node("node-1")
                                .port(7773)
                                .url("127.0.0.1:7771,127.0.0.1:7772").
                                build())
                .build()
                .start().block();
  在smqtt-bootstrap/target目录下生成jar
准备配置文件 config.yaml
启动服务
  java -jar smqtt-bootstrap-1.0.1-SNAPSHOT.jar <config.yaml路径>
拉取镜像
# 拉取docker镜像地址
docker pull 1ssqq1lxr/smqtt:latest
启动镜像默认配置
# 启动服务
docker run -it  -p 1883:1883 1ssqq1lxr/smqtt
启动镜像使用自定义配置(同上准备配置文件config.yaml)
# 启动服务
docker run -it  -v <配置文件路径目录>:/conf -p 1883:1883  -p 1999:1999 1ssqq1lxr/smqtt
引入依赖
<dependency>
    <groupId>io.github.quickmsg</groupId>
    <artifactId>smqtt-spring-boot-starter</artifactId>
    <version>${Latest version >= 1.0.8}</version>
</dependency>
启动类Application上添加注解   @EnableMqttServer
配置application.yml文件
properties也支持,但是需要自己转换,没有提供demo文件
启动springboot服务服务即可
如果引入的是spring-boot-starter-parent的管理包,如果启动报错,则需要添加以下依赖
<dependency>
    <groupId>io.projectreactor</groupId>
    <artifactId>reactor-core</artifactId>
    <version>3.4.9</version>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>1.0.10</version>
</dependency>
![]()
![]()
![]()
![]()
一款非常好用的IOT平台 thinglinks:
![]()
Lemon877164954,拉入smqtt官方交流群700152283