diff --git a/.gitignore b/.gitignore
index d51be2f6e01449f28a65a77a44eaf0233e770489..7ea256ffb7e64b2932659b88b6ca03695e112796 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,7 @@
./.idea/**
/.idea/
target/
-
+*.versionsBackup
# Log file
*.log
@@ -26,4 +26,5 @@ target/
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
-
+/ignite/
+./ignite/**
diff --git a/README.md b/README.md
index 8178277e170fd5c639b24de5c4d36ee821512a15..c38d5147b101c121c1d3e65655f458f3e5009186 100644
--- a/README.md
+++ b/README.md
@@ -1,143 +1,210 @@
-## SMQTT是一款开源的MQTT消息代理Broker,
+## SMQTT重磅升级
+感谢大家帮忙给新项目点Star,感谢!
+- [Gitee](https://gitee.com/quickmsg/smqttx)
+- [Github](https://github.com/quickmsg/smqttx)
+-
+
+
+##  SMQTT开源的MQTT消息代理Broker
+
+SMQTT基于reactor-netty(spring-webflux底层依赖)
+开发,底层采用Reactor3反应堆模型,支持单机部署,支持容器化部署,具备低延迟,高吞吐量,支持百万TCP连接,同时支持多种协议交互,是一款非常优秀的消息中间件!
-SMQTT基于Netty开发,底层采用Reactor3反应堆模型,支持单机部署,支持容器化部署,具备低延迟,高吞吐量,支持百万TCP连接,同时支持多种协议交互,是一款非常优秀的消息中间件!
## smqtt目前拥有的功能如下:
-1. 消息质量等级实现(支持qos0,qos1,qos2)
-2. 会话消息
-3. 保留消息
-4. 遗嘱消息
-5. 客户端认证
-6. tls加密
-7. websocket协议支持
-8. http协议交互
-9. SPI接口扩展支持
+
+
+1. 消息质量等级实现(支持qos0,qos1,qos2)
+2. topicFilter支持
+ - topic分级(test/test)
+ - +支持(单层匹配)
+ - *支持(多层匹配)
+3. 会话消息
+ - 默认内存存储
+ - 支持持久化(redis/db)
+4. 保留消息
+ - 默认内存存储
+ - 支持持久化(redis/db)
+5. 遗嘱消息
+
+ > 设备掉线时候触发
+6. 客户端认证
+ - 支持spi注入外部认证
+7. tls加密
+ - 支持tls加密(mqtt端口/http端口)
+8. websocket协议支持x
+
+ > 使用mqtt over websocket
+9. http协议交互
+ - 支持http接口推送消息
+ - 支持spi扩展http接口
+10. SPI接口扩展支持
- 消息管理接口(会话消息/保留消息管理)
- 通道管理接口 (管理系统的客户端连接)
- - 认证接口 (用于自定义外部认证)
- - 拦截器 (用户自定义拦截消息)
-10. 集群支持(gossip协议实现)
-11. 容器化支持
-12. 持久化支持(session 保留消息)
+ - ~~认证接口 (用于自定义外部认证)~~
+ - 拦截器 (用户自定义拦截消息)
+11. 集群支持(gossip协议实现)
+12. 容器化支持
+
+ > 默认镜像最新tag: 1ssqq1lxr/smqtt
+13. 持久化支持(session 保留消息)
+14. 规则引擎支持
+15. 支持springboot starter启动
+16. 管理后台
+
+ > 请参考smqtt文档如何启动管理后台
+17. grafana监控集成
+ - 支持influxdb
+ - 支持prometheus
+18. ACL权限管理
+ - 对设备、资访问授权
+19. 认证模块
+ - 支持http
+ - 支持匿名
+ - 支持固定密码
+ - 支持sql
+
+## 尝试一下
+
+> 大家不要恶意链接,谢谢!
+| 管理 | 说明 | 其他 |
+|----------------------------------------| ---- |---- |
+| 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 |
+## 启动方式
-## main方式启动
+### main方式启动
引入依赖
+
```markdown
+
io.github.quickmsg
smqtt-core
- 1.0.5
+ ${Latest version}
+
+
+
+ smqtt-registry-scube
+ io.github.quickmsg
+ ${Latest version}
+
+
+
+ smqtt-ui
+ io.github.quickmsg
+ ${Latest version}
-
```
-阻塞式启动服务:
+- 阻塞式启动服务:
```markdown
-
- Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})
- .ssl(false)
- .reactivePasswordAuth((U,P)->true)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).accessLog(true).build())
- .build()
- .startAwait();
-
+ 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();
```
-非阻塞式启动服务:
+- 非阻塞式启动服务:
```markdown
-
-
- Bootstrap bootstrap =
- Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).accessLog(true).build())
- .build()
- .start().block();
-
-assert bootstrap != null;
- // 关闭服务
- bootstrap.shutdown();
-
+ 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();
```
+### jar方式
-## jar方式
-
-
-1. 下载源码 mvn compile package -Dmaven.test.skip=true -P jar
+1. 下载源码 mvn compile package -Dmaven.test.skip=true -P jar,web
```markdown
在smqtt-bootstrap/target目录下生成jar
```
-2. 准备配置文件 config.properties
+2. 准备配置文件 config.yaml
-```markdown
-
- # 开启tcp端口
- smqtt.tcp.port=1883
- # 高水位
- smqtt.tcp.lowWaterMark=4000000
- # 低水位
- smqtt.tcp.highWaterMark=80000000
- # 开启ssl加密
- smqtt.tcp.ssl=false
- # 证书crt smqtt.tcp.ssl.crt =
- # 证书key smqtt.tcp.ssl.key =
- # 开启日志
- smqtt.tcp.wiretap=false
- # boss线程
- smqtt.tcp.bossThreadSize=4
- # work线程
- smqtt.tcp.workThreadSize=8
- # websocket端口
- smqtt.websocket.port=8999
- # websocket开启
- smqtt.websocket.enable=true
- # smqtt用户
- smqtt.tcp.username=smqtt
- # smqtt密码
- smqtt.tcp.password=smqtt
- # 开启http
- smqtt.http.enable=true
- # 开启http端口
- smqtt.http.port=1999
- # 开启http日志
- smqtt.http.accesslog=true
- # 开启ssl
- smqtt.http.ssl.enable=false
- # smqtt.http.ssl.crt =
- # smqtt.http.ssl.key
- ```
+ [config.yaml](config/config.yaml)
3. 启动服务
```markdown
- java -jar smqtt-bootstrap-1.0.1-SNAPSHOT.jar
+ java -jar smqtt-bootstrap-1.0.1-SNAPSHOT.jar
```
-
-
-## docker 方式
-
+### docker 方式
拉取镜像
@@ -153,44 +220,99 @@ docker pull 1ssqq1lxr/smqtt:latest
docker run -it -p 1883:1883 1ssqq1lxr/smqtt
```
-启动镜像使用自定义配置( 准备配置文件conf.properties)
-
+启动镜像使用自定义配置(同上准备配置文件config.yaml)
```
# 启动服务
docker run -it -v <配置文件路径目录>:/conf -p 1883:1883 -p 1999:1999 1ssqq1lxr/smqtt
```
+### springboot方式
-## 测试服务(启动http端口)
+1. 引入依赖
-- 启动客户端订阅主题 test/+
+ ```markdown
+
+ io.github.quickmsg
+ smqtt-spring-boot-starter
+ ${Latest version >= 1.0.8}
+
+ ```
-- 使用http接口推送mqtt消息
+2. 启动类Application上添加注解 ` @EnableMqttServer`
-```
-# 推送消息
-curl -H "Content-Type: application/json" -X POST -d '{"topic": "test/teus", "qos":2, "retain":true, "message":"我来测试保留消息3" }' "http://localhost:1999/smqtt/publish"
+3. 配置application.yml文件
+ > properties也支持,但是需要自己转换,没有提供demo文件
+
+ [config.yaml](config/config.yaml)
+
+4. 启动springboot服务服务即可
+5. 如果引入的是spring-boot-starter-parent的管理包,如果启动报错,则需要添加以下依赖
+
+```xml
+
+
+ io.projectreactor
+ reactor-core
+ 3.4.9
+
+
+io.projectreactor.netty
+reactor-netty
+1.0.10
+
```
+## 官网地址
+[smqtt官网](https://www.smqtt.cc/)
## wiki地址
-集群类配置参考文档:
+[wiki地址](https://wiki.smqtt.cc/)
+
+## 管理后台
+
+
+
+## 监控页面
-[smqtt文档](https://quickmsg.github.io/smqtt)
+### Mqtt监控
+
+
+
+### Jvm监控
+
+
+
+### Netty监控
+
+
## License
-[Apache License, Version 2.0](https://github.com/quickmsg/smqtt/blob/main/LICENSE)
+[Apache License, Version 2.0](LICENSE)
+
+## 商业版本
+[商业版演示地址](http://114.116.14.30)
+## 友情链接
+
+一款非常好用的IOT平台 thinglinks:
+
+- [Github](https://github.com/mqttsnet/thinglinks)
+- [Gitee](https://gitee.com/mqttsnet/thinglinks)
+
+## 相关技术文档
+
+- [reactor3](https://projectreactor.io/docs/core/release/reference/)
+- [reactor-netty](https://projectreactor.io/docs/netty/1.0.12/reference/index.html)
## 麻烦关注下公众号!
+

- 添加微信号`Lemon877164954`,拉入smqtt官方交流群
- 加入qq群 `700152283`
-
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000000000000000000000000000000000..034e848032092eaf8ef96eac731b6ed5961987f3
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,21 @@
+# Security Policy
+
+## Supported Versions
+
+Use this section to tell people about which versions of your project are
+currently being supported with security updates.
+
+| Version | Supported |
+| ------- | ------------------ |
+| 5.1.x | :white_check_mark: |
+| 5.0.x | :x: |
+| 4.0.x | :white_check_mark: |
+| < 4.0 | :x: |
+
+## Reporting a Vulnerability
+
+Use this section to tell people how to report a vulnerability.
+
+Tell them where to go, how often they can expect to get an update on a
+reported vulnerability, what to expect if the vulnerability is accepted or
+declined, etc.
diff --git a/config.properties b/config.properties
deleted file mode 100644
index 156849c5632e4cf6628ea924433a7abc88f45a03..0000000000000000000000000000000000000000
--- a/config.properties
+++ /dev/null
@@ -1,90 +0,0 @@
-# 日志级别 ALL|TRACE|DEBUG|INFO|WARN|ERROR|OFF
-smqtt.log.level=info
-# 开启tcp端口
-smqtt.tcp.port=1883
-# 高水位
-smqtt.tcp.lowWaterMark=4000000
-# 低水位
-smqtt.tcp.highWaterMark=80000000
-# 开启ssl加密
-smqtt.tcp.ssl=false
-# 证书crt smqtt.tcp.ssl.crt =
-# 证书key smqtt.tcp.ssl.key =
-# 开启日志
-smqtt.tcp.wiretap=false
-# boss线程
-smqtt.tcp.bossThreadSize=4
-# work线程
-smqtt.tcp.workThreadSize=8
-# websocket端口
-smqtt.websocket.port=8999
-# websocket开启
-smqtt.websocket.enable=true
-# smqtt用户
-smqtt.tcp.username=smqtt
-# smqtt密码
-smqtt.tcp.password=smqtt
-# 开启http
-smqtt.http.enable=true
-# 开启http端口
-smqtt.http.port=60000
-# 开启http日志
-smqtt.http.accesslog=true
-# 开启ssl
-smqtt.http.ssl.enable=false
-# smqtt.http.ssl.crt =;
-# smqtt.http.ssl.key;
-# 开启集群
-smqtt.cluster.enable=false
-# 集群节点地址
-smqtt.cluster.url=127.0.0.1:7771,127.0.0.1:7772
-# 节点端口
-smqtt.cluster.port=7771
-# 节点名称
-smqtt.cluster.node=node-1
-
-# 数据库配置(选配)
-db.driverClassName=com.mysql.jdbc.Driver
-db.url=jdbc:mysql://127.0.0.1:3306/smqtt?characterEncoding=utf-8&useSSL=false&useInformationSchema=true&serverTimezone=UTC
-db.username=root
-db.password=123
-# 连接池初始化连接数
-db.initialSize=10
-# 连接池中最多支持多少个活动会话
-db.maxActive=300
-# 向连接池中请求连接时,超过maxWait的值后,认为本次请求失败
-db.maxWait=60000
-# 回收空闲连接时,将保证至少有minIdle个连接
-db.minIdle=2
-
-# redis配置(选配)
-# 单机模式:single 哨兵模式:sentinel 集群模式:cluster
-redis.mode=single
-# 数据库
-redis.database=0
-# 密码
-redis.password=
-# 超时时间
-redis.timeout=3000
-# 最小空闲数
-redis.pool.min.idle=8
-# 连接超时时间(毫秒)
-redis.pool.conn.timeout=3000
-# 连接池大小
-redis.pool.size=10
-
-# 单机配置
-redis.single.address=127.0.0.1:6379
-
-# 集群配置
-redis.cluster.scan.interval=1000
-redis.cluster.nodes=127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003,127.0.0.1:7004,127.0.0.1:7005
-redis.cluster.read.mode=SLAVE
-redis.cluster.retry.attempts=3
-redis.cluster.slave.connection.pool.size=64
-redis.cluster.master.connection.pool.size=64
-redis.cluster.retry.interval=1500
-
-# 哨兵配置
-redis.sentinel.master=mymaster
-redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26379,127.0.0.1:26379
\ No newline at end of file
diff --git a/config/acl/basic_policy.csv b/config/acl/basic_policy.csv
new file mode 100644
index 0000000000000000000000000000000000000000..ca87dd9f23c79be67351b0a9077de269b6f46fc5
--- /dev/null
+++ b/config/acl/basic_policy.csv
@@ -0,0 +1,4 @@
+p, client01, topicA, PUBLISH,allow
+p, client02, topicB, PUBLISH,deny
+p, ip{192.168.0.172/24}, topicB, PUBLISH,deny
+p, all, topicB, SUBSCRIBE,allow
diff --git a/config/config.yaml b/config/config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..f7896c153c3cb68f6134363a035e852c8ea47e93
--- /dev/null
+++ b/config/config.yaml
@@ -0,0 +1,97 @@
+smqtt:
+ logLevel: INFO # 系统日志
+ tcp: # tcp配置
+ connectModel: KICK # UNIQUE 唯一 KICK 互踢
+ notKickSecond: 30 # KICK互踢模式生效, 单位秒, 指定时间内客户端不互踢, 避免客户端自动连接持续互踢
+ port: 1883 # mqtt端口号
+ wiretap: false # 二进制日志 前提是 smqtt.logLevel = DEBUG
+ bossThreadSize: 1 # boss线程 默认=1
+ workThreadSize: 9 # work线程 默认=cpu核心数+1
+ businessThreadSize: 8 # 业务线程数 默认=cpu核心数
+ businessQueueSize: 100000 #业务队列 默认=100000
+ messageMaxSize: 4194304 # 接收消息的最大限制 默认4194304(4M)
+ lowWaterMark: 4000000 # 不建议配置 默认 32768
+ highWaterMark: 80000000 # 不建议配置 默认 65536
+ # globalReadWriteSize: 10000000,100000000 全局读写大小限制
+ # channelReadWriteSize: 10000000,100000000 单个channel读写大小限制
+ options:
+ SO_BACKLOG: 2000
+# ssl: # ssl配置
+# enable: false # 开关
+# key: /user/server.key # 指定ssl文件 默认系统生成
+# crt: /user/server.crt # 指定ssl文件 默认系统生成
+# ca: /user/server.ca # ca证书 双向加密配置
+ acl:
+ aclPolicy: NONE # NONE or FILE or JDBC
+ filePath: D:\smqtt\config\acl\basic_policy.csv # FILE时配置filePath
+ jdbcAclConfig:
+ driver: com.mysql.jdbc.Driver
+ url: jdbc:mysql://127.0.0.1:3306/smqtt
+ username: root
+ password: 123
+ http: # http相关配置 端口固定60000
+ enable: true # 开关
+ accessLog: true # http访问日志
+ ssl: # ssl配置
+ enable: false
+ admin: # 后台管理配置
+ enable: true # 开关
+ username: smqtt # 访问用户名
+ password: smqtt # 访问密码
+ auth:
+ fixed:
+ username: smqtt
+ password: smqtt
+ ws: # websocket配置
+ enable: true # 开关
+ port: 8999 # 端口
+ path: /mqtt # ws 的访问path mqtt.js请设置此选项
+ cluster: # 集群配置
+ enable: false # 集群开关
+ url: 127.0.0.1:7771,127.0.0.1:7772 # 启动节点
+ port: 7771 # 端口
+ node: node-1 # 集群节点名称 唯一
+ namespace: smqtt
+ external:
+ host: localhost # 用于映射容器ip 请不要随意设置,如果不需要请移除此选项
+ port: 7777 # 用于映射容器端口 请不要随意设置,如果不需要请移除此选项
+ meter:
+ meterType: PROMETHEUS # INFLUXDB , PROMETHEUS
+ db: # 参数值配置参考https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
+ jdbcUrl: jdbc:mysql://localhost:3306/smqtt
+ username: root
+ password: 123
+ dataSourceCachePrepStmts: false
+ dataSourcePrepStmtCacheSize: 250
+ dataSourcePrepStmtCacheSqlLimit: 2048
+ dataSourceUseServerPrepStmts: true
+ dataSourceUseLocalSessionState: true
+ dataSourceRewriteBatchedStatements: true
+ dataSourceCacheResultSetMetadata: true
+ dataSourceCacheServerConfiguration: true
+ dataSourceElideSetAutoCommits: true
+ dataSourceMaintainTimeStats: false
+ redis: # redis 请参考 https://wiki.smqtt.cc/%E5%85%B6%E4%BB%96/1.store.html 【如果没有引入相关依赖请移除此配置】
+ mode: single
+ database: 0
+ password:
+ timeout: 3000
+ poolMinIdle: 8
+ poolConnTimeout: 3000
+ poolSize: 10
+ single:
+ address: 127.0.0.1:6379
+ cluster:
+ scanInterval: 1000
+ nodes: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003,127.0.0.1:7004,127.0.0.1:7005
+ readMode: SLAVE
+ retryAttempts: 3
+ slaveConnectionPoolSize: 64
+ masterConnectionPoolSize: 64
+ retryInterval: 1500
+ sentinel:
+ master: mymaster
+ nodes: 127.0.0.1:26379,127.0.0.1:26379,127.0.0.1:26379
+
+
+
diff --git a/config/monitor/prometheus/smqtt-application-1638608184756.json b/config/monitor/prometheus/smqtt-application-1638608184756.json
new file mode 100644
index 0000000000000000000000000000000000000000..2dc0aed806559eb7526cc1b15e78f012d566fbab
--- /dev/null
+++ b/config/monitor/prometheus/smqtt-application-1638608184756.json
@@ -0,0 +1,737 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "gnetId": null,
+ "graphTooltip": 2,
+ "id": 2,
+ "iteration": 1638607798289,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 5,
+ "panels": [],
+ "repeat": null,
+ "title": "实时数据",
+ "type": "row"
+ },
+ {
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 8,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "text": {},
+ "textMode": "auto"
+ },
+ "pluginVersion": "8.2.0",
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "smqtt_connect_count{instance=\"$instance\"}",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 1,
+ "legendFormat": "连接计数",
+ "refId": "A"
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "连接计数",
+ "transformations": [],
+ "type": "stat"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 1
+ },
+ "id": 10,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "last"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "text": {},
+ "textMode": "auto"
+ },
+ "pluginVersion": "8.2.0",
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "smqtt_subscribe_count{instance=\"$instance\"}",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "订阅数",
+ "type": "stat"
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 9
+ },
+ "id": 6,
+ "panels": [],
+ "title": "事件(qps)",
+ "type": "row"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 10
+ },
+ "id": 18,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_publish_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "publish",
+ "refId": "A"
+ }
+ ],
+ "title": "publish",
+ "type": "timeseries"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 10
+ },
+ "id": 24,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_connect_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "connect",
+ "refId": "A"
+ }
+ ],
+ "title": "connect",
+ "type": "timeseries"
+ },
+ {
+ "datasource": null,
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 18
+ },
+ "id": 22,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_subscribe_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "subscribe",
+ "refId": "A"
+ }
+ ],
+ "title": "subscribe",
+ "type": "timeseries"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 18
+ },
+ "id": 20,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_close_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "close",
+ "type": "timeseries"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 26
+ },
+ "id": 14,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_unscribe_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "unscribe",
+ "refId": "A"
+ }
+ ],
+ "title": "unscribe",
+ "type": "timeseries"
+ },
+ {
+ "datasource": null,
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 26
+ },
+ "id": 16,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single"
+ }
+ },
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "rate(smqtt_disconnect_event_count_total{instance=\"$instance\"}[1m])",
+ "interval": "",
+ "legendFormat": "disconnect",
+ "refId": "A"
+ }
+ ],
+ "title": "disconnect",
+ "type": "timeseries"
+ }
+ ],
+ "refresh": "5s",
+ "schemaVersion": 31,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "192.168.124.62:60000",
+ "value": "192.168.124.62:60000"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": false,
+ "label": "instance",
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": {
+ "query": "label_values(smqtt_connect_count, instance)",
+ "refId": "Prometheus-instance-Variable-Query"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": {
+ "from": "now-5m",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "timezone": "",
+ "title": "smqtt-application",
+ "uid": "EnxLlX57z",
+ "version": 5
+}
\ No newline at end of file
diff --git a/config/monitor/prometheus/smqtt-jvm-1638607233202.json b/config/monitor/prometheus/smqtt-jvm-1638607233202.json
new file mode 100644
index 0000000000000000000000000000000000000000..101c1bd24e60b1931302eb221c94023f6b0569d1
--- /dev/null
+++ b/config/monitor/prometheus/smqtt-jvm-1638607233202.json
@@ -0,0 +1,2806 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "limit": 100,
+ "name": "Annotations & Alerts",
+ "showIn": 0,
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ },
+ {
+ "datasource": "Prometheus",
+ "enable": true,
+ "expr": "resets(process_uptime_seconds{application=\"$application\", instance=\"$instance\"}[1m]) > 0",
+ "iconColor": "rgba(255, 96, 96, 1)",
+ "name": "Restart Detection",
+ "showIn": 0,
+ "step": "1m",
+ "tagKeys": "restart-tag",
+ "textFormat": "uptime reset",
+ "titleFormat": "Restart"
+ }
+ ]
+ },
+ "description": "smqtt jvm",
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "gnetId": 4701,
+ "graphTooltip": 1,
+ "id": 3,
+ "iteration": 1638607226416,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 125,
+ "panels": [],
+ "repeat": null,
+ "title": "Quick Facts",
+ "type": "row"
+ },
+ {
+ "cacheTimeout": null,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "decimals": 2,
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "rgba(50, 172, 45, 0.97)",
+ "value": null
+ },
+ {
+ "color": "rgba(237, 129, 40, 0.89)",
+ "value": 70
+ },
+ {
+ "color": "rgba(245, 54, 54, 0.9)",
+ "value": 90
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 6,
+ "x": 0,
+ "y": 1
+ },
+ "id": 65,
+ "interval": null,
+ "links": [],
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "text": {},
+ "textMode": "auto"
+ },
+ "pluginVersion": "8.2.0",
+ "targets": [
+ {
+ "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"heap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "refId": "A",
+ "step": 14400
+ }
+ ],
+ "title": "Heap used",
+ "type": "stat"
+ },
+ {
+ "cacheTimeout": null,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "decimals": 2,
+ "mappings": [
+ {
+ "options": {
+ "match": "null",
+ "result": {
+ "text": "N/A"
+ }
+ },
+ "type": "special"
+ },
+ {
+ "options": {
+ "from": -1e+32,
+ "result": {
+ "text": "N/A"
+ },
+ "to": 0
+ },
+ "type": "range"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "rgba(50, 172, 45, 0.97)",
+ "value": null
+ },
+ {
+ "color": "rgba(237, 129, 40, 0.89)",
+ "value": 70
+ },
+ {
+ "color": "rgba(245, 54, 54, 0.9)",
+ "value": 90
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 6,
+ "x": 6,
+ "y": 1
+ },
+ "id": 75,
+ "interval": null,
+ "links": [],
+ "maxDataPoints": 100,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "horizontal",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "text": {},
+ "textMode": "auto"
+ },
+ "pluginVersion": "8.2.0",
+ "targets": [
+ {
+ "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"nonheap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "refId": "A",
+ "step": 14400
+ }
+ ],
+ "title": "Non-Heap used",
+ "type": "stat"
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 4
+ },
+ "id": 126,
+ "panels": [],
+ "repeat": null,
+ "title": "JVM Memory",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 0,
+ "y": 5
+ },
+ "hiddenSeries": false,
+ "id": 24,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "committed",
+ "refId": "B",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "max",
+ "refId": "C",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "JVM Heap",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 6,
+ "y": 5
+ },
+ "hiddenSeries": false,
+ "id": 25,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "committed",
+ "refId": "B",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "max",
+ "refId": "C",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "JVM Non-Heap",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 12,
+ "y": 5
+ },
+ "hiddenSeries": false,
+ "id": 26,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "committed",
+ "refId": "B",
+ "step": 2400
+ },
+ {
+ "expr": "sum(jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "max",
+ "refId": "C",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "JVM Total",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 18,
+ "y": 5
+ },
+ "hiddenSeries": false,
+ "id": 86,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "process_memory_vss_bytes{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "hide": true,
+ "intervalFactor": 2,
+ "legendFormat": "vss",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "process_memory_rss_bytes{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "rss",
+ "refId": "B"
+ },
+ {
+ "expr": "process_memory_swap_bytes{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "swap",
+ "refId": "C"
+ },
+ {
+ "expr": "process_memory_rss_bytes{application=\"$application\", instance=\"$instance\"} + process_memory_swap_bytes{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "total",
+ "refId": "D"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "JVM Process Memory",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 12
+ },
+ "id": 127,
+ "panels": [],
+ "repeat": null,
+ "title": "JVM Misc",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 0,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 106,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "system_cpu_usage{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "hide": false,
+ "intervalFactor": 1,
+ "legendFormat": "system",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "process_cpu_usage{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "hide": false,
+ "intervalFactor": 1,
+ "legendFormat": "process",
+ "refId": "B"
+ },
+ {
+ "expr": "avg_over_time(process_cpu_usage{application=\"$application\", instance=\"$instance\"}[1h])",
+ "format": "time_series",
+ "hide": false,
+ "intervalFactor": 1,
+ "legendFormat": "process-1h",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "CPU Usage",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": 1,
+ "format": "percentunit",
+ "label": "",
+ "logBase": 1,
+ "max": "1",
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 6,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 93,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "system_load_average_1m{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "system-1m",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "system_cpu_count{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "cpus",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Load",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": 1,
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 12,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 32,
+ "legend": {
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_threads_live_threads{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "live",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "jvm_threads_daemon_threads{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "daemon",
+ "metric": "",
+ "refId": "B",
+ "step": 2400
+ },
+ {
+ "expr": "jvm_threads_peak_threads{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "peak",
+ "refId": "C",
+ "step": 2400
+ },
+ {
+ "expr": "process_threads{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "process",
+ "refId": "D",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Threads",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": 0,
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {
+ "blocked": "#bf1b00",
+ "new": "#fce2de",
+ "runnable": "#7eb26d",
+ "terminated": "#511749",
+ "timed-waiting": "#c15c17",
+ "waiting": "#eab839"
+ },
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 18,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 124,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_threads_states_threads{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "{{state}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Thread States",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 20
+ },
+ "id": 128,
+ "panels": [],
+ "repeat": "persistence_counts",
+ "title": "JVM Memory Pools (Heap)",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 8,
+ "x": 0,
+ "y": 21
+ },
+ "hiddenSeries": false,
+ "id": 3,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "maxPerRow": 3,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "repeat": "jvm_memory_pool_heap",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 1800
+ },
+ {
+ "expr": "jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "commited",
+ "metric": "",
+ "refId": "B",
+ "step": 1800
+ },
+ {
+ "expr": "jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_heap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "max",
+ "metric": "",
+ "refId": "C",
+ "step": 1800
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "$jvm_memory_pool_heap",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 28
+ },
+ "id": 129,
+ "panels": [],
+ "repeat": null,
+ "title": "JVM Memory Pools (Non-Heap)",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 8,
+ "x": 0,
+ "y": 29
+ },
+ "hiddenSeries": false,
+ "id": 78,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "maxPerRow": 3,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "repeat": "jvm_memory_pool_nonheap",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 1800
+ },
+ {
+ "expr": "jvm_memory_committed_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "commited",
+ "metric": "",
+ "refId": "B",
+ "step": 1800
+ },
+ {
+ "expr": "jvm_memory_max_bytes{application=\"$application\", instance=\"$instance\", id=~\"$jvm_memory_pool_nonheap\"}",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "max",
+ "metric": "",
+ "refId": "C",
+ "step": 1800
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "$jvm_memory_pool_nonheap",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "mbytes",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 36
+ },
+ "id": 130,
+ "panels": [],
+ "repeat": null,
+ "title": "Garbage Collection",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 8,
+ "x": 0,
+ "y": 37
+ },
+ "hiddenSeries": false,
+ "id": 98,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "rate(jvm_gc_pause_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])",
+ "format": "time_series",
+ "hide": false,
+ "intervalFactor": 1,
+ "legendFormat": "{{action}} ({{cause}})",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Collections",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "ops",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 8,
+ "x": 8,
+ "y": 37
+ },
+ "hiddenSeries": false,
+ "id": 101,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "rate(jvm_gc_pause_seconds_sum{application=\"$application\", instance=\"$instance\"}[1m])/rate(jvm_gc_pause_seconds_count{application=\"$application\", instance=\"$instance\"}[1m])",
+ "format": "time_series",
+ "hide": false,
+ "instant": false,
+ "intervalFactor": 1,
+ "legendFormat": "avg {{action}} ({{cause}})",
+ "refId": "A"
+ },
+ {
+ "expr": "jvm_gc_pause_seconds_max{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "hide": false,
+ "instant": false,
+ "intervalFactor": 1,
+ "legendFormat": "max {{action}} ({{cause}})",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Pause Durations",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "s",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 8,
+ "x": 16,
+ "y": 37
+ },
+ "hiddenSeries": false,
+ "id": 99,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "rate(jvm_gc_memory_allocated_bytes_total{application=\"$application\", instance=\"$instance\"}[1m])",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 1,
+ "legendFormat": "allocated",
+ "refId": "A"
+ },
+ {
+ "expr": "rate(jvm_gc_memory_promoted_bytes_total{application=\"$application\", instance=\"$instance\"}[1m])",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 1,
+ "legendFormat": "promoted",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Allocated/Promoted",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "Bps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 44
+ },
+ "id": 131,
+ "panels": [],
+ "repeat": null,
+ "title": "Classloading",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 0,
+ "y": 45
+ },
+ "hiddenSeries": false,
+ "id": 37,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_classes_loaded_classes{application=\"$application\", instance=\"$instance\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "loaded",
+ "metric": "",
+ "refId": "A",
+ "step": 1200
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Classes loaded",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 12,
+ "y": 45
+ },
+ "hiddenSeries": false,
+ "id": 38,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "delta(jvm_classes_loaded_classes{application=\"$application\",instance=\"$instance\"}[1m])",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 1,
+ "legendFormat": "delta-1m",
+ "metric": "",
+ "refId": "A",
+ "step": 1200
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Class delta",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "ops",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": null,
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 52
+ },
+ "id": 132,
+ "panels": [],
+ "repeat": null,
+ "title": "Buffer Pools",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 0,
+ "y": 53
+ },
+ "hiddenSeries": false,
+ "id": 33,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_buffer_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=\"direct\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "jvm_buffer_total_capacity_bytes{application=\"$application\", instance=\"$instance\", id=\"direct\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "capacity",
+ "metric": "",
+ "refId": "B",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Direct Buffers",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 6,
+ "y": 53
+ },
+ "hiddenSeries": false,
+ "id": 83,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_buffer_count_buffers{application=\"$application\", instance=\"$instance\", id=\"direct\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "count",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Direct Buffers",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": 0,
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 12,
+ "y": 53
+ },
+ "hiddenSeries": false,
+ "id": 85,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_buffer_memory_used_bytes{application=\"$application\", instance=\"$instance\", id=\"mapped\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ },
+ {
+ "expr": "jvm_buffer_total_capacity_bytes{application=\"$application\", instance=\"$instance\", id=\"mapped\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "capacity",
+ "metric": "",
+ "refId": "B",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Mapped Buffers",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "fillGradient": 0,
+ "grid": {
+ "leftLogBase": 1,
+ "leftMax": null,
+ "leftMin": null,
+ "rightLogBase": 1,
+ "rightMax": null,
+ "rightMin": null
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 6,
+ "x": 18,
+ "y": 53
+ },
+ "hiddenSeries": false,
+ "id": 84,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "jvm_buffer_count_buffers{application=\"$application\", instance=\"$instance\", id=\"mapped\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "count",
+ "metric": "",
+ "refId": "A",
+ "step": 2400
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Mapped Buffers",
+ "tooltip": {
+ "msResolution": false,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "x-axis": true,
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "y-axis": true,
+ "y_formats": [
+ "short",
+ "short"
+ ],
+ "yaxes": [
+ {
+ "decimals": 0,
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": 0,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ }
+ ],
+ "refresh": "30s",
+ "schemaVersion": 31,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "smqtt",
+ "value": "smqtt"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": false,
+ "label": "Application",
+ "multi": false,
+ "name": "application",
+ "options": [],
+ "query": {
+ "query": "label_values(application)",
+ "refId": "Prometheus-application-Variable-Query"
+ },
+ "refresh": 2,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allFormat": "glob",
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "192.168.124.62:60000",
+ "value": "192.168.124.62:60000"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": false,
+ "label": "Instance",
+ "multi": false,
+ "multiFormat": "glob",
+ "name": "instance",
+ "options": [],
+ "query": {
+ "query": "label_values(jvm_memory_used_bytes{application=\"$application\"}, instance)",
+ "refId": "Prometheus-instance-Variable-Query"
+ },
+ "refresh": 2,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allFormat": "glob",
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": true,
+ "label": "JVM Memory Pools Heap",
+ "multi": false,
+ "multiFormat": "glob",
+ "name": "jvm_memory_pool_heap",
+ "options": [],
+ "query": {
+ "query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"},id)",
+ "refId": "Prometheus-jvm_memory_pool_heap-Variable-Query"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allFormat": "glob",
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": true,
+ "label": "JVM Memory Pools Non-Heap",
+ "multi": false,
+ "multiFormat": "glob",
+ "name": "jvm_memory_pool_nonheap",
+ "options": [],
+ "query": {
+ "query": "label_values(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"},id)",
+ "refId": "Prometheus-jvm_memory_pool_nonheap-Variable-Query"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 2,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": {
+ "from": "now-24h",
+ "to": "now"
+ },
+ "timepicker": {
+ "now": true,
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "timezone": "browser",
+ "title": "smqtt-jvm",
+ "uid": "3veYlXc7z",
+ "version": 2
+}
\ No newline at end of file
diff --git a/config/monitor/prometheus/smqtt-netty-1638607270130.json b/config/monitor/prometheus/smqtt-netty-1638607270130.json
new file mode 100644
index 0000000000000000000000000000000000000000..7aab0a8cc37174bede0f94445645449a41f19a57
--- /dev/null
+++ b/config/monitor/prometheus/smqtt-netty-1638607270130.json
@@ -0,0 +1,687 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "gnetId": null,
+ "graphTooltip": 0,
+ "id": 1,
+ "iteration": 1638607265684,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 6,
+ "panels": [],
+ "title": "Tcp",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 11,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "hiddenSeries": false,
+ "id": 1,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "sum(reactor_netty_tcp_server_data_received_bytes_count{instance=\"$instance\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_received_bytes_count",
+ "refId": "A"
+ },
+ {
+ "exemplar": true,
+ "expr": "max(reactor_netty_tcp_server_data_received_bytes_max{instance=\"$instance\"})",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_received_bytes_max",
+ "refId": "B"
+ },
+ {
+ "exemplar": true,
+ "expr": "sum(reactor_netty_tcp_server_data_received_bytes_sum{instance=\"$instance\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_received_bytes_sum",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Tcp Received Bytes",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 11,
+ "w": 12,
+ "x": 12,
+ "y": 1
+ },
+ "hiddenSeries": false,
+ "id": 2,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(reactor_netty_tcp_server_data_sent_bytes_count{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_sent_bytes_count",
+ "refId": "A"
+ },
+ {
+ "expr": "sum(reactor_netty_tcp_server_data_sent_bytes_max{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_sent_bytes_max",
+ "refId": "B"
+ },
+ {
+ "expr": "sum(reactor_netty_tcp_server_data_sent_bytes_sum{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_tcp_server_data_sent_bytes_sum",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Tcp Sent Bytes",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 12
+ },
+ "id": 7,
+ "panels": [],
+ "title": "Bytebuf监控",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 11,
+ "w": 12,
+ "x": 0,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 3,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "exemplar": true,
+ "expr": "sum(reactor_netty_bytebuf_allocator_chunk_size{instance=\"$instance\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_chunk_size",
+ "refId": "A"
+ },
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_direct_arenas{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_direct_arenas",
+ "refId": "B"
+ },
+ {
+ "exemplar": true,
+ "expr": "sum(reactor_netty_bytebuf_allocator_heap_arenas{instance=\"$instance\"})",
+ "format": "time_series",
+ "interval": "",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_heap_arenas",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Bytebuf分配",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 11,
+ "w": 12,
+ "x": 12,
+ "y": 13
+ },
+ "hiddenSeries": false,
+ "id": 5,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_used_direct_memory{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_used_direct_memory",
+ "refId": "A"
+ },
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_used_heap_memory{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_used_heap_memory",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Bytebuf使用",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 11,
+ "w": 12,
+ "x": 0,
+ "y": 24
+ },
+ "hiddenSeries": false,
+ "id": 4,
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "8.2.0",
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_normal_cache_size{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_normal_cache_size",
+ "refId": "A"
+ },
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_small_cache_size{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_small_cache_size",
+ "refId": "B"
+ },
+ {
+ "expr": "sum(reactor_netty_bytebuf_allocator_threadlocal_caches{instance=\"$instance\"})",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "reactor_netty_bytebuf_allocator_threadlocal_caches",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Bytebuf缓存",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ }
+ ],
+ "refresh": "",
+ "schemaVersion": 31,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "192.168.124.62:60000",
+ "value": "192.168.124.62:60000"
+ },
+ "datasource": "Prometheus",
+ "definition": "",
+ "description": null,
+ "error": null,
+ "hide": 0,
+ "includeAll": false,
+ "label": "instance",
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": {
+ "query": "label_values(reactor_netty_bytebuf_allocator_heap_arenas, instance)",
+ "refId": "Prometheus-instance-Variable-Query"
+ },
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": {
+ "from": "now-6h",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "timezone": "",
+ "title": "smqtt-netty",
+ "uid": "rIDE_Xc7z",
+ "version": 10
+}
\ No newline at end of file
diff --git a/docs/.debug.yml b/docs/.debug.yml
deleted file mode 100644
index 05d534a00755a7d5259372c61cf977285bee4453..0000000000000000000000000000000000000000
--- a/docs/.debug.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-remote_theme: false
-
-theme: jekyll-rtd-theme
\ No newline at end of file
diff --git a/docs/CNAME b/docs/CNAME
deleted file mode 100644
index 02bb93e5bbecbb398201a259315b316519b5eed5..0000000000000000000000000000000000000000
--- a/docs/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-doc.smqtt.cc
\ No newline at end of file
diff --git a/docs/Gemfile b/docs/Gemfile
deleted file mode 100644
index ccd8f63fd63d3ece0b07d593df6ab699c7d3cf72..0000000000000000000000000000000000000000
--- a/docs/Gemfile
+++ /dev/null
@@ -1,4 +0,0 @@
-source "https://gems.ruby-china.com"
-gem "jekyll-rtd-theme"
-
-gem "github-pages", group: :jekyll_plugins
\ No newline at end of file
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 100644
index db29e5ad3fb29fd4feedeb6b24968e5b0845bbcc..0000000000000000000000000000000000000000
--- a/docs/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-DEBUG=JEKYLL_GITHUB_TOKEN=blank PAGES_API_URL=http://0.0.0.0
-
-default:
- @gem install jekyll bundler && bundle install
-
-update:
- @bundle update
-
-clean:
- @bundle exec jekyll clean
-
-build: clean
- @${DEBUG} bundle exec jekyll build --profile --config _config.yml,.debug.yml
-
-server: clean
- @${DEBUG} bundle exec jekyll server --livereload --config _config.yml,.debug.yml
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index b15a895185b5aa8a7cbea180de3b559bee2ac5de..0000000000000000000000000000000000000000
--- a/docs/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# SMQTT文档
-
-SMQTT基于Netty开发,底层采用Reactor3反应堆模型,支持单机部署,支持容器化部署,具备低延迟,高吞吐量,支持百万TCP连接,同时支持多种协议交互,是一款非常优秀的消息中间件!
-[项目地址](https://github.com/quickmsg/smqtt)
-
-## smqtt目前拥有的功能如下:
-
-1. 消息质量等级实现(支持qos0,qos1,qos2)
-2. 会话消息
-3. 保留消息
-4. 遗嘱消息
-5. 客户端认证
-6. tls加密
-7. websocket协议支持
-8. http协议交互
-9. SPI接口扩展支持
- - 消息管理接口(会话消息/保留消息管理)
- - 通道管理接口 (管理系统的客户端连接)
- - 认证接口 (用于自定义外部认证)
- - 拦截器 (用户自定义拦截消息)
-10. 集群支持(gossip协议实现)
-11. 容器化支持
-
-
-## 后面规划项目
-
-- 规则引擎
-- Web管理系统
-- 监控系统
-- 协议桥接agent(用户其他协议与broker之间交互)
-
-
-
-## 麻烦关注下公众号!
-
-
-- 添加微信号`Lemon877164954`,拉入smqtt官方交流群
-- 加入qq群 `700152283`
\ No newline at end of file
diff --git a/docs/_config.yml b/docs/_config.yml
deleted file mode 100644
index c5198849d2419513ecc931bc476d0de7cbd7d5dd..0000000000000000000000000000000000000000
--- a/docs/_config.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-title: SMQTT文档
-lang: en
-description: a catchy description for your project
-
-remote_theme: rundocs/jekyll-rtd-theme
-
-readme_index:
- with_frontmatter: true
-
-exclude:
- - Makefile
- - CNAME
- - Gemfile
- - Gemfile.lock
\ No newline at end of file
diff --git a/docs/cluster/1.jar.md b/docs/cluster/1.jar.md
deleted file mode 100644
index 1024f94f392d84d45bacd4658e0f9fb54c300c7f..0000000000000000000000000000000000000000
--- a/docs/cluster/1.jar.md
+++ /dev/null
@@ -1,102 +0,0 @@
----
-sort: 1
----
-
-# main启动配置
-
-## 引入依赖
-```markdown
-
- io.github.quickmsg
- smqtt-core
- 1.0.5
-
-
- io.github.quickmsg
- smqtt-registry-scube
- 1.0.5
-
-```
-
-## 集群启动类
-
-示例如下:
-
-1. cluster-node1
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .lowWaterMark(1000)
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(true)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).httpPort(62212).accessLog(true).build())
- .clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
- .port(7773)
- .nodeName("node-2")
- .clusterUrl("127.0.0.1:7771,127.0.0.1:7772")
- .build())
- .build()
- .start().block();
-```
-2. cluster-node2
-
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .port(8556)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .lowWaterMark(1000)
- .ssl(false)
- .wiretap(true)
- .clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
- .port(7772)
- .nodeName("node-3")
- .clusterUrl("127.0.0.1:7771,127.0.0.1:7773")
- .build())
- .build()
- .start().block();
-```
-3. cluster-node3
-
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .port(8551)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .lowWaterMark(1000)
- .ssl(false)
- .wiretap(true)
- .clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
- .port(7771)
- .nodeName("node-4")
- .clusterUrl("127.0.0.1:7772,127.0.0.1:7773")
- .build())
- .build()
- .start().block();
-```
-
-## 启动参数详解
-
-ClusterConfig参数:
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| clustered | 开启集群 |是 |
-| port | 集群通信端口 |是 |
-| nodeName | 节点名称唯一 |是 |
-| clusterUrl | 集群节点url |是|
-
diff --git a/docs/cluster/README.md b/docs/cluster/README.md
deleted file mode 100644
index 348b31b4b0de090b995af891bdb9534fd0b8e876..0000000000000000000000000000000000000000
--- a/docs/cluster/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 5
----
-# 集群文档
-
-{% include list.liquid %}
\ No newline at end of file
diff --git a/docs/http/1.wd.md b/docs/http/1.wd.md
deleted file mode 100644
index 40a27357bee353320b53c236a7353a50bcf035e0..0000000000000000000000000000000000000000
--- a/docs/http/1.wd.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-sort: 1
----
-
-# 启动http
-
-启动Broker时候开启Http服务:
-
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .httpOptions(Bootstrap.HttpOptions
- .builder()
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .accessLog(true).build())
- .build()
- .start().block();
-```
-Bootstrap.HttpOptions参数:
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| ssl | 开启ssl加密 |否 |
-| sslContext | ssl证书配置,为空则使用系统生成 |否 |
-| httpPort | http服务端口,为空则随机端口 |否 |
-| accessLog | http日志开启 |否 |
-
-sslContext参数:
-
-| sslContext | 说明 | 必传 |
-| ---- | ---- |---- |
-| server.crt | CA认证后的证书文件 |是|
-| server.key | 密钥文件 |是 |
\ No newline at end of file
diff --git a/docs/http/2.fs.md b/docs/http/2.fs.md
deleted file mode 100644
index 632187e88d3727729ac5d6047b06f6569f4c58ca..0000000000000000000000000000000000000000
--- a/docs/http/2.fs.md
+++ /dev/null
@@ -1,189 +0,0 @@
----
-sort: 2
----
-
-# http内置接口
-
-
-
-
-- ##推送消息接口
-
-> 系统内置了io.github.quickmsg.core.http.PublishActor接口,用于推送mqtt消息。使用方式如下:
-
-- 请求url /smqtt/publish
-- 请求方式 POST
-- 请求Body
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| topic | topiuc |是 |
-| qos | 服务等级 |是 |
-| retain | 保留消息 |是 |
-| message | 消息 |是 |
-
-- 返回body
-空
-- 返回状态码
-200 成功
-
-
-```
-curl -H "Content-Type: application/json" -X POST -d '{"topic": "test/teus", "qos":2, "retain":true, "message":"我来测试保留消息3" }' "http://localhost:1999/smqtt/publish"
-```
-
-
-- ##获取当前连接
-
-> 系统内置了io.github.quickmsg.core.http.ConnectionActor,用于获取当前连接。使用方式如下:
-
-- 请求url /smqtt/connection
-- 请求方式 POST
-- 请求Body
- 无
-- 返回Body
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| connection | 连接 |是 |
-| status | 状态 |是 |
-| activeTime | 激活时间 |是 |
-| authTime | 认证时间 |是 |
-| sessionPersistent | session开启 |是 |
-| will | 遗嘱消息 |是 |
-| keepalive | 心跳时间 |是 |
-| topics | 订阅topic |是 |
-
-```markdown
-[
- {
- "activeTime": 1624113398783,
- "authTime": 1624113398805,
- "clientIdentifier": "mqttx_20fe13251",
- "connection": {
- "disposed": false,
- "inboundCancelled": false,
- "inboundDisposed": false,
- "persistent": true,
- "subscriptionDisposed": false
- },
- "keepalive": 60,
- "sessionPersistent": true,
- "status": "ONLINE",
- "topics": [],
- "will": {
- "mqttQoS": "AT_MOST_ONCE",
- "retain": false,
- "willMessage": "YXNkbmJsa2hhc2Jk",
- "willTopic": "test/close"
- }
- }
-]
-
-```
-- 发送请求
-
-```
-curl -H "Content-Type: application/json" -X POST "http://localhost:1999/smqtt/connection"
-```
-
-
-
-- ##获取当前集群信息
-
-> 系统内置了io.github.quickmsg.core.http.actors.ClusterActor,用于获取当前连接。使用方式如下:
-
-- 请求url /smqtt/cluster
-- 请求方式 POST
-- 请求Body
- 无
-- 返回Body
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| alias | node名称 |是 |
-| host | 主机ip |是 |
-| port | 端口 |是 |
-| namespace | 命名空间 |是 |
-
-```markdown
-[
- {
- "alias": "node-4",
- "host": "169.254.122.50",
- "namespace": "default",
- "port": 7771
- },
- {
- "alias": "node-3",
- "host": "169.254.122.50",
- "namespace": "default",
- "port": 7772
- },
- {
- "alias": "node-2",
- "host": "169.254.122.50",
- "namespace": "default",
- "port": 7773
- }
-]
-```
-
-
-- 发送请求
-
-```
-curl -H "Content-Type: application/json" -X POST "http://localhost:1999/smqtt/cluster"
-```
-
-- ##获取当前订阅信息
-
-> 系统内置了io.github.quickmsg.core.http.actors.SubscribeActor,用于获取当前连接。使用方式如下:
-
-- 请求url /smqtt/subscribe
-- 请求方式 POST
-- 请求Body
- 无
-- 返回Body
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| activeTime | 激活時間 |是 |
-| authTime | 认证时间 |是 |
-| clientIdentifier | 客户端id |是 |
-| keepalive | 心跳时间 |是 |
-| sessionPersistent | 是否持久化 |是 |
-| status | 在线状态 |是 |
-| topics | 订阅topic |是 |
-
-
-```markdown
-{
- "test/+": [
- {
- "activeTime": 1624110181885,
- "authTime": 1624110181923,
- "clientIdentifier": "client-id-3",
- "connection": {
- "disposed": false,
- "inboundCancelled": false,
- "inboundDisposed": false,
- "persistent": true,
- "subscriptionDisposed": false
- },
- "keepalive": 20,
- "sessionPersistent": true,
- "status": "ONLINE",
- "topics": [
- "test/+"
- ]
- }
- ]
-}
-```
-
-- 发送请求
-
-```
-curl -H "Content-Type: application/json" -X POST "http://localhost:1999/smqtt/cluster"
-```
\ No newline at end of file
diff --git a/docs/http/3.fs.md b/docs/http/3.fs.md
deleted file mode 100644
index 8705a5e93ea9086e696f0de62d6038fd3e4f1199..0000000000000000000000000000000000000000
--- a/docs/http/3.fs.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-sort: 3
----
-# http扩展接口
-
-## 注解使用
-
-使用@Router(value = "/smqtt/publish", type = HttpType.POST) 定义URL跟请求方式
-## 自定义实现接口
- - 实现io.github.quickmsg.common.http.HttpActor
- - 实现io.github.quickmsg.core.http.AbstractHttpActor(内置操作发送mqtt消息接口)
-
-下面给出实现demo:
-
-```
-@Router(value = "/smqtt/demo", type = HttpType.POST)
-@Slf4j
-public class DemoActor extends AbstractHttpActor {
-
-
- @Override
- public Publisher doRequest(HttpServerRequest request, HttpServerResponse response) {
- return request
- .receive()
- .asString()
- .map(this.toJson(HttpPublishMessage.class))
- .doOnNext(message -> {
- //处理request
- }).then(response.sendString(Mono.just("success")).then());
- }
-
-}
-```
-
-## SPI注入
-`具体参考java SPI注入`
-
-resources/WEB-INF/services 目录下新建
-名为io.github.quickmsg.common.http.HttpActor文件,
-将自定义实现类全限定名写入文件中即可完成注入。
\ No newline at end of file
diff --git a/docs/http/README.md b/docs/http/README.md
deleted file mode 100644
index f4d464d503a430147ef7bd2724579f45953e3473..0000000000000000000000000000000000000000
--- a/docs/http/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 4
----
-# http文档
-
-{% include list.liquid %}
\ No newline at end of file
diff --git a/docs/icon/icon.jpg b/docs/icon/icon.jpg
deleted file mode 100644
index cb2843461079c358042ebb0669a8c2f37a856df3..0000000000000000000000000000000000000000
Binary files a/docs/icon/icon.jpg and /dev/null differ
diff --git a/docs/mqtt/1.auth.md b/docs/mqtt/1.auth.md
deleted file mode 100644
index 092e9c7521573b74074c2b9dd37d506e39c95a4d..0000000000000000000000000000000000000000
--- a/docs/mqtt/1.auth.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sort: 2
----
-
-# 连接鉴权
-
-## 自定义认证类
-
-实现PasswordAuthentication接口
-
-- 请求参数
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| username | 用户名 |是 |
-| password | 密码 |是 |
-
-
-- 返回参数
-
- Boolean
-
-
-## 启动类注入认证
-
-```
- Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})
- .ssl(false)
- .reactivePasswordAuth((U,P)->true) //认证注入方法
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).httpPort(62212).accessLog(true).build())
- .build()
- .startAwait();
-```
-
-## SPI注入
-
-`具体参考java SPI注入`
-
-resources/WEB-INF/services 目录下新建
-名为io.github.quickmsg.common.auth.PasswordAuthentication文件,
-将自定义实现类全限定名写入文件中即可完成注入。
-
-
-
diff --git a/docs/mqtt/1.init.md b/docs/mqtt/1.init.md
deleted file mode 100644
index 8c929039613939885885b73cc89b32bafde4ed4c..0000000000000000000000000000000000000000
--- a/docs/mqtt/1.init.md
+++ /dev/null
@@ -1,50 +0,0 @@
----
-sort: 1
----
-
-# 启动mqtt
-
-## 启动参数详解
-
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .lowWaterMark(1000)
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(true)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).httpPort(62212).accessLog(true).build())
- .clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
- .port(7773)
- .nodeName("node-2")
- .clusterUrl("127.0.0.1:7771,127.0.0.1:7772")
- .build())
- .build()
- .start().block();
-```
-
-Bootstrap启动参数说明:
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| port | MQTT端口 |否 |
-| options | netty options参数设置 |否 |
-| childOptions | netty childOptions参数设置 |否 |
-| highWaterMark | 高水位 |否 |
-| lowWaterMark | 低水位 |否 |
-| ssl | ssl开关 |否 |
-| sslContext | ssl证书 |否|
-| wiretap | 二进制日志 |否
-| isWebsocket | websocket开关 |否
-| websocketPort | websocket端口 |否 |
-| httpOptions | http参数 (请参考Http配置文件)|否 |
-| clusterConfig | 集群配置(请参考集群配置文件) |否 |
-
-
diff --git a/docs/mqtt/README.md b/docs/mqtt/README.md
deleted file mode 100644
index 910c3670214d3ac9797ff342d666df89ad66865d..0000000000000000000000000000000000000000
--- a/docs/mqtt/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 2
----
-# mqtt文档
-
-{% include list.liquid %}
\ No newline at end of file
diff --git a/docs/websocket/1.init.md b/docs/websocket/1.init.md
deleted file mode 100644
index b71e0edacb69fd0886573d5e28b0be36717e3c9d..0000000000000000000000000000000000000000
--- a/docs/websocket/1.init.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-sort: 1
----
-
-# 启动webSocket
-
-
-```
- Bootstrap bootstrap = Bootstrap.builder()
- .websocketPort(8999)
- .isWebsocket(true)
- .build()
- .start().block();
-```
\ No newline at end of file
diff --git a/docs/websocket/README.md b/docs/websocket/README.md
deleted file mode 100644
index f1ae0122a7832ce6e71579be33d98c84268cd4ee..0000000000000000000000000000000000000000
--- a/docs/websocket/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 3
----
-# websocket文档
-
-{% include list.liquid %}
\ No newline at end of file
diff --git "a/docs/\345\205\245\351\227\250/1.docker.md" "b/docs/\345\205\245\351\227\250/1.docker.md"
deleted file mode 100644
index f6079332196c9b821bc8adf8d4011bb38356a03b..0000000000000000000000000000000000000000
--- "a/docs/\345\205\245\351\227\250/1.docker.md"
+++ /dev/null
@@ -1,43 +0,0 @@
----
-sort: 3
----
-
-# Docker启动
-
-
-## 拉取镜像
-
-```
-# 拉取docker镜像地址
-docker pull 1ssqq1lxr/smqtt:latest
-```
-
-## 使用环境变量启动
-
-```
-docker run -it -e smqtt.tcp.port=1883 -e smqtt.http.enable=true -p 1883:1883 1ssqq1lxr/smqtt
-```
-
-## 使用配置文件启动
-- 准备配置文件conf.properties
-- 启动服务
-
-
-```
-docker run -it -v <配置文件路径目录>:/conf -p <宿主机port>:<配置文件port> 1ssqq1lxr/smqtt
-```
-
-## 构建镜像推送到私有仓库
-
-- 下载源码
-- 执行命令
-
-```
-mvn clean package -Dmaven.test.skip=true -Djib.to.auth.username={仓库账户} -Djib.to.auth.password={仓库密码}-P docker
-
-```
-
-
-
-
-
diff --git "a/docs/\345\205\245\351\227\250/1.jar.md" "b/docs/\345\205\245\351\227\250/1.jar.md"
deleted file mode 100644
index e615a457151cde72bb756db9cc8a4befc8731b5c..0000000000000000000000000000000000000000
--- "a/docs/\345\205\245\351\227\250/1.jar.md"
+++ /dev/null
@@ -1,67 +0,0 @@
----
-sort: 2
----
-
-# jar启动
-
-
-## 下载源码
-
-```markdown
- mvn compile package -Dmaven.test.skip=true -P jar
-```
-
-在smqtt-bootstrap/target目录下生成jar
-
-## 使用配置文件 config.properties
-
-```markdown
-
- # 开启tcp端口
- smqtt.tcp.port=1883
- # 高水位
- smqtt.tcp.lowWaterMark=4000000
- # 低水位
- smqtt.tcp.highWaterMark=80000000
- # 开启ssl加密
- smqtt.tcp.ssl=false
- # 证书crt smqtt.tcp.ssl.crt =
- # 证书key smqtt.tcp.ssl.key =
- # 开启日志
- smqtt.tcp.wiretap=false
- # boss线程
- smqtt.tcp.bossThreadSize=4
- # work线程
- smqtt.tcp.workThreadSize=8
- # websocket端口
- smqtt.websocket.port=8999
- # websocket开启
- smqtt.websocket.enable=true
- # smqtt用户
- smqtt.tcp.username=smqtt
- # smqtt密码
- smqtt.tcp.password=smqtt
- # 开启http
- smqtt.http.enable=true
- # 开启http端口
- smqtt.http.port=1999
- # 开启http日志
- smqtt.http.accesslog=true
- # 开启ssl
- smqtt.http.ssl.enable=false
- # smqtt.http.ssl.crt =
- # smqtt.http.ssl.key=
- ```
-
-## 不使用配置文件
-使用jvm启动参数:
-
-```markdown
- java -jar -Dsmqtt.tcp.port=1883 -Dsmqtt.http.enable=true smqtt-bootstrap-1.0.5.jar
-```
-## 启动服务
-
-```markdown
- java -jar smqtt-bootstrap-1.0.1-SNAPSHOT.jar
-```
-
diff --git "a/docs/\345\205\245\351\227\250/1.main.md" "b/docs/\345\205\245\351\227\250/1.main.md"
deleted file mode 100644
index 8bd6a01c38641e504929621c0f3a1db2db5cfc97..0000000000000000000000000000000000000000
--- "a/docs/\345\205\245\351\227\250/1.main.md"
+++ /dev/null
@@ -1,55 +0,0 @@
----
-sort: 1
----
-
-# main方式启动
-
-
-## 引入依赖
-```markdown
-
- io.github.quickmsg
- smqtt-core
- 1.0.5
-
-```
-
-## 阻塞式启动服务:
-
-```markdown
-
- Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).httpPort(62212).accessLog(true).build())
- .build()
- .startAwait();
-```
-
-## 非阻塞式启动服务:
-
- ```markdown
-
- Bootstrap bootstrap =
- Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {})
- .ssl(false)
- .sslContext(new SslContext("crt","key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).httpPort(62212).accessLog(true).build())
- .build()
- .start().block();
-
-assert bootstrap != null;
- // 关闭服务
- bootstrap.shutdown();
-
-```
\ No newline at end of file
diff --git "a/docs/\345\205\245\351\227\250/README.md" "b/docs/\345\205\245\351\227\250/README.md"
deleted file mode 100644
index 136cb36a2d5254ea945f67029eff3f5d9a27b6ff..0000000000000000000000000000000000000000
--- "a/docs/\345\205\245\351\227\250/README.md"
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 1
----
-# 启动
-
-{% include list.liquid %}
\ No newline at end of file
diff --git "a/docs/\345\205\266\344\273\226/1.interceptor.md" "b/docs/\345\205\266\344\273\226/1.interceptor.md"
deleted file mode 100644
index 0dc104e360bf9cb6a99095a42e8514b81adadebc..0000000000000000000000000000000000000000
--- "a/docs/\345\205\266\344\273\226/1.interceptor.md"
+++ /dev/null
@@ -1,81 +0,0 @@
----
-sort: 1
----
-
-# 拦截器
-
-
-## Interceptor接口详解
-
-- io.github.quickmsg.common.interceptor.Interceptor
-
-| 方法 | 说明 | 必传 |
-| ---- | ---- |---- |
-| Object doInterceptor(Invocation invocation) | 拦截方法 |是 |
-| int order() | 拦截排序 |是 |
-
-
-
-- Invocation 属性说明
-
-| 参数 | 说明 | 必传 |
-| ---- | ---- |---- |
-| method | 请求的 MqttChannel |是 |
-| target | 请求的 MqttMessage |是 |
-| args | 请求的ReceiveContext |是 |
-
-- 方法
-
-| 方法 | 说明 |
-| ---- | ---- |
-| public Object proceed() | 放行拦截器|
-
-
-## 自定义拦截器
-
-- 实现接口
-
-```markdown
-
-public class DemoInterceptor implements Interceptor {
-
-
- @Override
- public Object intercept(Invocation invocation) {
- try {
- Method method = invocation.getMethod();
- Object[] args = invocation.getArgs();
- Object target = invocation.getTarget();
-// MqttChannel mqttChannel, MqttMessage mqttMessage, ReceiveContext receiveContext
-
- MqttChannel mqttChannel = (MqttChannel) args[0]; // channel
- MqttMessage mqttMessage = (MqttMessage) args[1]; // MqttMessage
- ReceiveContext receiveContext = (ReceiveContext) args[2]; // ReceiveContext
-
- // 拦截业务
-
- return invocation.proceed(); // 放行
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public int sort() {
- return 0;
- }
-}
-
-```
-
-
-- SPI注入
-
-`具体参考java SPI注入`
-
-resources/WEB-INF/services 目录下新建
-名为io.github.quickmsg.common.interceptor.Interceptor文件,
-将自定义实现类全限定名写入文件中即可完成注入。
diff --git "a/docs/\345\205\266\344\273\226/1.store.md" "b/docs/\345\205\266\344\273\226/1.store.md"
deleted file mode 100644
index 065b4dd361b70a07ee5e195a031aa60ac303a12a..0000000000000000000000000000000000000000
--- "a/docs/\345\205\266\344\273\226/1.store.md"
+++ /dev/null
@@ -1,123 +0,0 @@
----
-sort: 2
----
-
-# 数据持久化
-
-## 持久化接口
-
-- 接口:`io.github.quickmsg.common.message.MessageRegistry`
-
-> 主要提供 session消息 && 保留消息的持久化
-
-| 方法 | 说明 |
-| ---- | ---- |
-| List getSessionMessages(String clientIdentifier) | 获取连接下线后的session消息 |
-| void saveSessionMessages(SessionMessage sessionMessage) | 保存连接下线后的session消息 |
-| void saveRetainMessage(RetainMessage retainMessage) | 保留Topic保留消息|
-| List getRetainMessage(String topic)| 获取Topic保留消息 |
-
-
-### 使用数据库去存储session/保留消息
-
-- 引入DB依赖
-```markdown
-
- io.github.quickmsg
- smqtt-persistent-db
- 1.0.5
-
-```
-- 引入驱动依赖
-> 根据版本引入 mysql/pg/oracle等驱动依赖
-```markdown
-
-
- mysql
- mysql-connector-java
- 5.1.35
-
-```
-
-- 服务启动时config.properties 添加 配置参数
-
-```markdown
-# 数据库配置
-db.driverClassName=com.mysql.jdbc.Driver
-db.url=jdbc:mysql://127.0.0.1:3306/smqtt?characterEncoding=utf-8&useSSL=false&useInformationSchema=true&serverTimezone=UTC
-db.username=root
-db.password=123
-# 连接池初始化连接数
-db.initialSize=10
-# 连接池中最多支持多少个活动会话
-db.maxActive=300
-# 向连接池中请求连接时,超过maxWait的值后,认为本次请求失败
-db.maxWait=60000
-# 回收空闲连接时,将保证至少有minIdle个连接
-db.minIdle=2
-
-```
-
-- 启动服务后会自动生成session表跟retain表
-
-### 使用Redis去存储session/保留消息
-
-* 引入依赖
-
-```markdown
-
- io.github.quickmsg
- smqtt-persistent-redis
- 1.0.5
-
-```
-
-* config.properties 配置参数
-
-```markdown
-# redis配置
-# 单机模式:single 哨兵模式:sentinel 集群模式:cluster
-redis.mode=single
-# 数据库
-redis.database=0
-# 密码
-redis.password=
-# 超时时间
-redis.timeout=3000
-# 最小空闲数
-redis.pool.min.idle=8
-# 连接超时时间(毫秒)
-redis.pool.conn.timeout=3000
-# 连接池大小
-redis.pool.size=10
-
-# 单机配置
-redis.single.address=127.0.0.1:6379
-
-# 集群配置
-# 集群扫描间隔时间(毫秒)
-redis.cluster.scan.interval=1000
-# 节点
-redis.cluster.nodes=127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003,127.0.0.1:7004,127.0.0.1:7005
-# 读取操作的负载均衡模式
-redis.cluster.read.mode=SLAVE
-# 命令失败重试次数
-redis.cluster.retry.attempts=3
-# 从节点连接池大小
-redis.cluster.slave.connection.pool.size=64
-# 主节点最小空闲连接数
-redis.cluster.master.connection.pool.size=64
-# 命令重试发送时间间隔(毫秒)
-redis.cluster.retry.interval=1500
-
-# 哨兵配置
-# master名称
-redis.sentinel.master=mymaster
-# 节点
-redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26379,127.0.0.1:26379
-```
-
-### 自定义实现持久化
-resources/WEB-INF/services 目录下新建
-名为`io.github.quickmsg.common.message.MessageRegistry`文件,
-将自定义实现类全限定名写入文件中即可完成注入。
diff --git "a/docs/\345\205\266\344\273\226/README.md" "b/docs/\345\205\266\344\273\226/README.md"
deleted file mode 100644
index 65e19d36e52ff79f1c02c353c021ad68a2094be6..0000000000000000000000000000000000000000
--- "a/docs/\345\205\266\344\273\226/README.md"
+++ /dev/null
@@ -1,6 +0,0 @@
----
-sort: 6
----
-# 其他
-
-{% include list.liquid %}
\ No newline at end of file
diff --git a/icon/admin.png b/icon/admin.png
new file mode 100644
index 0000000000000000000000000000000000000000..0705398e206068530b942c909239a99920b08413
Binary files /dev/null and b/icon/admin.png differ
diff --git a/icon/application.png b/icon/application.png
new file mode 100644
index 0000000000000000000000000000000000000000..5b12aebcc7cd2a46bff85b49ef1021ac910b6dfc
Binary files /dev/null and b/icon/application.png differ
diff --git a/icon/component.png b/icon/component.png
index 95c59e2abdbdee7d0d32a0d6bb6dcee478528798..0c005f7d013701a6d4bcd82c6d802f75e38b27da 100644
Binary files a/icon/component.png and b/icon/component.png differ
diff --git a/icon/jvm.png b/icon/jvm.png
new file mode 100644
index 0000000000000000000000000000000000000000..afdf14df56dcd5a30d6f4b2cc7fd3818ceb44bfb
Binary files /dev/null and b/icon/jvm.png differ
diff --git a/icon/logo.png b/icon/logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..fccf31bebe01f420d75bfba0119c235483c2000f
Binary files /dev/null and b/icon/logo.png differ
diff --git a/icon/netty.png b/icon/netty.png
new file mode 100644
index 0000000000000000000000000000000000000000..2ea49d94b1b5d007af1c6076db5a4ec7d1e2bd17
Binary files /dev/null and b/icon/netty.png differ
diff --git a/icon/smqtt.jpg b/icon/smqtt.jpg
deleted file mode 100644
index be402efe3990b837c0180fda361ad63a718247da..0000000000000000000000000000000000000000
Binary files a/icon/smqtt.jpg and /dev/null differ
diff --git a/icon/smqtt.png b/icon/smqtt.png
deleted file mode 100644
index 068d3dab8598584e4a35755262ed54fb9655336b..0000000000000000000000000000000000000000
Binary files a/icon/smqtt.png and /dev/null differ
diff --git a/pom.xml b/pom.xml
index f091eff2ea1b668b5834955a492938ea758bbf1a..cb2e46ad8ce4c19a49a0cd9e64593948f3b10df5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
io.github.quickmsg
smqtt
- 1.0.5
+ 1.1.7
smqtt-common
smqtt-core
@@ -14,6 +14,8 @@
smqtt-persistent
smqtt-rule
smqtt-ui
+ smqtt-metric
+ smqtt-spring-boot-starter
pom
@@ -25,11 +27,12 @@
UTF-8
1.8
1.8
- 1.0.5
- 1.18.6
- 2020.0.6
+ 1.18.20
+ 2020.0.10
1.7.30
2.11.0
+ 2.12.4
+ 2.12.4
@@ -55,8 +58,24 @@
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${jackson.dataform.version}
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-properties
+ ${jackson.dataform.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.core.version}
+
-
com.fasterxml.jackson
jackson-bom
@@ -79,12 +98,7 @@
io.netty
netty-codec-mqtt
- 4.1.60.Final
-
-
- com.alibaba
- fastjson
- 1.2.70
+ 4.1.66.Final
org.projectlombok
@@ -107,17 +121,56 @@
logback-classic
1.1.11
+
+ io.micrometer
+ micrometer-core
+ 1.8.0
+
+
+ com.github.oshi
+ oshi-core
+ 5.3.6
+
+
+ io.micrometer
+ micrometer-registry-prometheus
+ 1.8.0
+
+
+ io.micrometer
+ micrometer-registry-influx
+ 1.8.0
+
+
+
+ org.casbin
+ jcasbin
+ 1.22.1
+
+
+
+ org.casbin
+ jdbc-adapter
+ 2.1.3
+
+
+
+ mysql
+ mysql-connector-java
+ 5.1.35
+
+
+
release
- true
+ false
-
org.sonatype.plugins
@@ -176,7 +229,6 @@
-
diff --git a/smqtt-bootstrap/pom.xml b/smqtt-bootstrap/pom.xml
index b52179e0f82cf32a85299763dd3b3cb149bc3a70..e3fd05673e5ae737a3ad1837113156aebbfa0db8 100644
--- a/smqtt-bootstrap/pom.xml
+++ b/smqtt-bootstrap/pom.xml
@@ -7,10 +7,10 @@
smqtt
io.github.quickmsg
- 1.0.5
+ 1.1.7
smqtt-bootstrap
- 1.0.5
+ 1.1.7
smqtt-bootstrap
http://www.example.com
@@ -21,6 +21,21 @@
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-properties
+
junit
junit
@@ -30,17 +45,22 @@
io.github.quickmsg
smqtt-core
- 1.0.5
+ 1.1.7
smqtt-registry-scube
io.github.quickmsg
- 1.0.5
+ 1.1.7
smqtt-ui
io.github.quickmsg
- 1.0.5
+ 1.1.7
+
+
+
+ mysql
+ mysql-connector-java
@@ -100,19 +120,24 @@
latest
${project.version}
+
+ ${REGISTRY_USERNAME}
+ ${REGISTRY_PASSWORD}
+
+
io.github.quickmsg.docker.DockerStarter
-
-
-
-
+
+
+
+
-
-
-
+
+
+
USE_CURRENT_TIMESTAMP
diff --git a/smqtt-bootstrap/src/main/java/io/github/quickmsg/AbstractStarter.java b/smqtt-bootstrap/src/main/java/io/github/quickmsg/AbstractStarter.java
index b5611d8dc03ecb06f079251e0f0acb228c99638c..5c95e352dd87252e618fc8a851c8493820b41057 100644
--- a/smqtt-bootstrap/src/main/java/io/github/quickmsg/AbstractStarter.java
+++ b/smqtt-bootstrap/src/main/java/io/github/quickmsg/AbstractStarter.java
@@ -1,20 +1,17 @@
package io.github.quickmsg;
import ch.qos.logback.classic.Level;
-import io.github.quickmsg.common.bootstrap.BootstrapKey;
-import io.github.quickmsg.common.cluster.ClusterConfig;
-import io.github.quickmsg.common.config.SslContext;
-import io.github.quickmsg.common.environment.EnvContext;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.javaprop.JavaPropsFactory;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
+import io.github.quickmsg.common.config.BootstrapConfig;
+import io.github.quickmsg.common.utils.FileExtension;
import io.github.quickmsg.common.utils.IPUtils;
-import io.github.quickmsg.common.utils.LoggerLevel;
-import io.github.quickmsg.common.utils.PropertiesLoader;
import io.github.quickmsg.core.Bootstrap;
-import io.netty.channel.WriteBufferWaterMark;
+import io.github.quickmsg.exception.NotSupportConfigException;
import lombok.extern.slf4j.Slf4j;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.function.Function;
+import java.io.File;
/**
* @author luxurong
@@ -22,162 +19,65 @@ import java.util.function.Function;
@Slf4j
public abstract class AbstractStarter {
- private static final String DEFAULT_PROPERTIES_LOAD_CONFIG_PATH = "/conf/config.properties";
- private static final Integer DEFAULT_MQTT_PORT = 1883;
-
- private static final Integer DEFAULT_WEBSOCKET_MQTT_PORT = 8999;
-
- private static final Integer DEFAULT_CLUSTER_PORT = 4333;
-
-
- private static final Integer DEFAULT_HTTP_PORT = 12000;
-
-
- private static final String DEFAULT_AUTH_USERNAME_PASSWORD = "smqtt";
-
- public static void start(Function function) {
- start(function, null);
- }
-
-
- public static void start(Function function, String path) {
- path = path == null ? DEFAULT_PROPERTIES_LOAD_CONFIG_PATH : path;
- EnvContext params = PropertiesLoader.loadProperties(path);
-
- Integer port = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_PORT, function.apply(BootstrapKey.BOOTSTRAP_PORT)))
- .map(Integer::parseInt).orElse(DEFAULT_MQTT_PORT);
-
- Integer lowWaterMark = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_LOW_WATERMARK, function.apply(BootstrapKey.BOOTSTRAP_LOW_WATERMARK)))
- .map(Integer::parseInt).orElse(WriteBufferWaterMark.DEFAULT.low());
-
- Integer highWaterMark = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HIGH_WATERMARK, function.apply(BootstrapKey.BOOTSTRAP_HIGH_WATERMARK)))
- .map(Integer::parseInt).orElse(WriteBufferWaterMark.DEFAULT.high());
-
- Boolean wiretap = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_WIRETAP, function.apply(BootstrapKey.BOOTSTRAP_WIRETAP)))
- .map(Boolean::parseBoolean).orElse(false);
-
- Integer bossThreadSize = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_BOSS_THREAD_SIZE, function.apply(BootstrapKey.BOOTSTRAP_BOSS_THREAD_SIZE)))
- .map(Integer::parseInt).orElse(Runtime.getRuntime().availableProcessors() >> 1);
-
- Integer workThreadSize = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_WORK_THREAD_SIZE, function.apply(BootstrapKey.BOOTSTRAP_WORK_THREAD_SIZE)))
- .map(Integer::parseInt).orElse(Runtime.getRuntime().availableProcessors());
-
- Boolean isWebsocket = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_WEB_SOCKET_ENABLE, function.apply(BootstrapKey.BOOTSTRAP_WEB_SOCKET_ENABLE)))
- .map(Boolean::parseBoolean).orElse(false);
-
- Boolean ssl = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_SSL, function.apply(BootstrapKey.BOOTSTRAP_SSL)))
- .map(Boolean::parseBoolean).orElse(false);
-
- String username = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_USERNAME, function.apply(BootstrapKey.BOOTSTRAP_USERNAME)))
- .map(String::valueOf).orElse(DEFAULT_AUTH_USERNAME_PASSWORD);
-
- String password = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_PASSWORD, function.apply(BootstrapKey.BOOTSTRAP_PASSWORD)))
- .map(String::valueOf).orElse(DEFAULT_AUTH_USERNAME_PASSWORD);
-
-
- Boolean httpEnable = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HTTP_ENABLE, function.apply(BootstrapKey.BOOTSTRAP_HTTP_ENABLE)))
- .map(Boolean::parseBoolean).orElse(false);
-
- Boolean clusterEnable = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_CLUSTER_ENABLE, function.apply(BootstrapKey.BOOTSTRAP_CLUSTER_ENABLE)))
- .map(Boolean::parseBoolean).orElse(false);
-
-
- String loggerLevel = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_LOGGER_LEVEL, function.apply(BootstrapKey.BOOTSTRAP_LOGGER_LEVEL)))
- .map(String::valueOf).orElse(null);
-
- if (loggerLevel != null) {
- LoggerLevel.root(Level.toLevel(loggerLevel));
- }
-
- Bootstrap.BootstrapBuilder builder = Bootstrap.builder();
- builder.port(port)
- .reactivePasswordAuth(((userName, passwordInBytes) -> userName.equals(username) && password.equals(new String(passwordInBytes))))
- .bossThreadSize(bossThreadSize)
- .wiretap(wiretap)
- .ssl(ssl)
- .workThreadSize(workThreadSize)
- .lowWaterMark(lowWaterMark)
- .envContext(params)
- .highWaterMark(highWaterMark);
-
- if (ssl) {
- String sslCrt = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_SSL_CRT, function.apply(BootstrapKey.BOOTSTRAP_SSL_CRT)))
- .map(String::valueOf).orElse(null);
- String sslKey = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_SSL_KEY, function.apply(BootstrapKey.BOOTSTRAP_SSL_KEY)))
- .map(String::valueOf).orElse(null);
- if (sslCrt == null || sslKey == null) {
- builder.sslContext(null);
+ public static void start(String path) {
+ BootstrapConfig config = null;
+ if (path != null) {
+ if (path.endsWith(FileExtension.PROPERTIES_SYMBOL)) {
+ ObjectMapper mapper = new ObjectMapper(new JavaPropsFactory());
+ try {
+ config = mapper.readValue(new File(path), BootstrapConfig.class);
+ } catch (Exception e) {
+ log.error("properties read error", e);
+ }
+ } else if (path.endsWith(FileExtension.YAML_SYMBOL_1) || path.endsWith(FileExtension.YAML_SYMBOL_2)) {
+ ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
+ try {
+ config = mapper.readValue(new File(path), BootstrapConfig.class);
+ } catch (Exception e) {
+ log.error("yaml read error", e);
+ return;
+ }
} else {
- builder.sslContext(new SslContext(sslCrt, sslKey));
+ throw new NotSupportConfigException();
}
}
- if (clusterEnable) {
- Integer clusterPort = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_CLUSTER_PORT, function.apply(BootstrapKey.BOOTSTRAP_CLUSTER_PORT)))
- .map(Integer::parseInt).orElse(DEFAULT_CLUSTER_PORT);
- String clusterUrl = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_CLUSTER_URL, function.apply(BootstrapKey.BOOTSTRAP_CLUSTER_URL)))
- .map(String::valueOf).orElse(null);
- String clusterNode = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_CLUSTER_NODE, function.apply(BootstrapKey.BOOTSTRAP_CLUSTER_NODE)))
- .map(String::valueOf).orElse(UUID.randomUUID().toString().replaceAll("-", ""));
- ClusterConfig clusterConfig =
- ClusterConfig.builder()
- .port(clusterPort)
- .clusterUrl(clusterUrl)
- .nodeName(clusterNode)
- .clustered(true)
- .build();
- builder.clusterConfig(clusterConfig);
+ if (config == null) {
+ config = BootstrapConfig.defaultConfig();
}
- if (isWebsocket) {
- Integer websocketPort = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_WEB_SOCKET_PORT, function.apply(BootstrapKey.BOOTSTRAP_WEB_SOCKET_PORT)))
- .map(Integer::parseInt).orElse(DEFAULT_WEBSOCKET_MQTT_PORT);
- builder.isWebsocket(true)
- .websocketPort(websocketPort);
- }
- if (httpEnable) {
- Bootstrap.HttpOptions.HttpOptionsBuilder optionsBuilder = Bootstrap.HttpOptions.builder();
-
- Boolean accessLog = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HTTP_ACCESS_LOG, function.apply(BootstrapKey.BOOTSTRAP_HTTP_ACCESS_LOG)))
- .map(Boolean::parseBoolean).orElse(false);
-
-
- Boolean httpSsl = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HTTP_SSL_ENABLE, function.apply(BootstrapKey.BOOTSTRAP_HTTP_SSL_ENABLE)))
- .map(Boolean::parseBoolean).orElse(false);
-
- if (httpSsl) {
- String httpSslCrt = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HTTP_SSL_CRT, function.apply(BootstrapKey.BOOTSTRAP_HTTP_SSL_CRT)))
- .map(String::valueOf).orElse(null);
- String httpSslKey = Optional.ofNullable(params.obtainKeyOrDefault(BootstrapKey.BOOTSTRAP_HTTP_SSL_KEY, function.apply(BootstrapKey.BOOTSTRAP_HTTP_SSL_KEY)))
- .map(String::valueOf).orElse(null);
- if (httpSslKey == null || httpSslCrt == null) {
- optionsBuilder.sslContext(null);
- } else {
- optionsBuilder.sslContext(new SslContext(httpSslCrt, httpSslKey));
- }
- }
- optionsBuilder
- .accessLog(accessLog)
- .ssl(httpSsl);
- Bootstrap.HttpOptions options = optionsBuilder.build();
- builder.httpOptions(options);
+ Bootstrap.builder()
+ .rootLevel(Level.toLevel(config.getSmqttConfig().getLogLevel()))
+ .tcpConfig(config.getSmqttConfig().getTcpConfig())
+ .httpConfig(config.getSmqttConfig().getHttpConfig())
+ .websocketConfig(config.getSmqttConfig().getWebsocketConfig())
+ .clusterConfig(config.getSmqttConfig().getClusterConfig())
+ .redisConfig(config.getSmqttConfig().getRedisConfig())
+ .databaseConfig(config.getSmqttConfig().getDatabaseConfig())
+ .meterConfig(config.getSmqttConfig().getMeterConfig())
+ .ruleChainDefinitions(config.getSmqttConfig().getRuleChainDefinitions())
+ .sourceDefinitions(config.getSmqttConfig().getRuleSources())
+ .aclConfig(config.getSmqttConfig().getAcl())
+ .authConfig(config.getSmqttConfig().getAuthConfig())
+ .build()
+ .doOnStarted(AbstractStarter::printUiUrl).startAwait();
- }
- Bootstrap bootstrap = builder.build();
- bootstrap.doOnStarted(bt -> printUIUrl(bootstrap.getHttpOptions().getHttpPort())).startAwait();
}
/**
* 打印前端访问地址
*
- * @param httpPort http端口
+ * @param bootstrap 启动类
*/
- public static void printUIUrl(Integer httpPort) {
- log.info("\n-------------------------------------------------------------\n\t" +
- "Application UI is running AccessURLs:\n\t" +
- "Http Local url: http://localhost:{}/smqtt/admin" + "\n\t" +
- "Http External url: http://{}:{}/smqtt/admin" + "\n" +
- "-------------------------------------------------------------"
- , httpPort, IPUtils.getIP(), httpPort);
+ public static void printUiUrl(Bootstrap bootstrap) {
+ String start = "\n-------------------------------------------------------------\n\t";
+ start += String.format("Smqtt mqtt connect url %s:%s \n\t", IPUtils.getIP(), bootstrap.getTcpConfig().getPort());
+ if (bootstrap.getHttpConfig() != null && bootstrap.getHttpConfig().isEnable()) {
+ Integer port = 60000;
+ start += String.format("Smqtt-Admin UI is running AccessURLs:\n\t" +
+ "Http Local url: http://localhost:%s/smqtt/admin" + "\n\t" +
+ "Http External url: http://%s:%s/smqtt/admin" + "\n" +
+ "-------------------------------------------------------------", port, IPUtils.getIP(), port);
+ }
+ log.info(start);
}
-
}
diff --git a/smqtt-bootstrap/src/main/java/io/github/quickmsg/docker/DockerStarter.java b/smqtt-bootstrap/src/main/java/io/github/quickmsg/docker/DockerStarter.java
index 951284f8d71f67cb1bc84570d408acbe89b216a7..2cab19c38751193a32ca96196901856d379fcb11 100644
--- a/smqtt-bootstrap/src/main/java/io/github/quickmsg/docker/DockerStarter.java
+++ b/smqtt-bootstrap/src/main/java/io/github/quickmsg/docker/DockerStarter.java
@@ -1,20 +1,42 @@
package io.github.quickmsg.docker;
import io.github.quickmsg.AbstractStarter;
+import io.github.quickmsg.common.utils.FileExtension;
import lombok.extern.slf4j.Slf4j;
+import java.io.File;
+
/**
* @author luxurong
*/
@Slf4j
public class DockerStarter extends AbstractStarter {
- private static final String CONFIG_MAPPER_DIR = "config.properties";
-
+ private final static String CONFIG_DIR_PATH = "/config";
public static void main(String[] args) {
log.info("DockerStarter start args {}", String.join(",", args));
- start(System::getenv, CONFIG_MAPPER_DIR);
+ start(findConfigByPath());
+ }
+
+ private static String findConfigByPath() {
+ File configFile = new File(CONFIG_DIR_PATH);
+ File[] files = configFile.listFiles();
+ if (files != null) {
+ for (File file : files) {
+ if (file.isDirectory()) {
+ continue;
+ }
+ String filename = file.getName();
+ if (filename.endsWith(FileExtension.PROPERTIES_SYMBOL)
+ || filename.endsWith(FileExtension.YAML_SYMBOL_1)
+ || filename.endsWith(FileExtension.YAML_SYMBOL_2)) {
+ return file.getAbsolutePath();
+ }
+ }
+ }
+
+ return null;
}
diff --git a/smqtt-bootstrap/src/main/java/io/github/quickmsg/exception/NotSupportConfigException.java b/smqtt-bootstrap/src/main/java/io/github/quickmsg/exception/NotSupportConfigException.java
new file mode 100644
index 0000000000000000000000000000000000000000..55acfa77b60fe5036caf99b20a7702dfd6609877
--- /dev/null
+++ b/smqtt-bootstrap/src/main/java/io/github/quickmsg/exception/NotSupportConfigException.java
@@ -0,0 +1,11 @@
+package io.github.quickmsg.exception;
+
+/**
+ * @author luxurong
+ */
+public class NotSupportConfigException extends RuntimeException {
+
+ public NotSupportConfigException() {
+ super("请使用properties/yaml配置文件");
+ }
+}
diff --git a/smqtt-bootstrap/src/main/java/io/github/quickmsg/jar/JarStarter.java b/smqtt-bootstrap/src/main/java/io/github/quickmsg/jar/JarStarter.java
index 8343db7b388fd1dc3750a9efc9d3fb3621c7fab4..bf30914c602d6341784adc53701ed9040bdd2342 100644
--- a/smqtt-bootstrap/src/main/java/io/github/quickmsg/jar/JarStarter.java
+++ b/smqtt-bootstrap/src/main/java/io/github/quickmsg/jar/JarStarter.java
@@ -3,18 +3,21 @@ package io.github.quickmsg.jar;
import io.github.quickmsg.AbstractStarter;
import lombok.extern.slf4j.Slf4j;
+import java.io.IOException;
+
/**
* @author luxurong
*/
@Slf4j
public class JarStarter extends AbstractStarter {
- public static void main(String[] args) {
+ public static void main(String[] args) throws IOException {
log.info("JarStarter start args {}", String.join(",", args));
if (args.length > 0) {
- start(System::getProperty, args[0]);
+ start(args[0]);
} else {
- start(System::getProperty, null);
+ start(null);
}
+
}
}
diff --git a/smqtt-bootstrap/src/main/resources/banner.txt b/smqtt-bootstrap/src/main/resources/banner.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1894e2c0089cb3d5da258c108a4d3815ab28b9ae
--- /dev/null
+++ b/smqtt-bootstrap/src/main/resources/banner.txt
@@ -0,0 +1,8 @@
+
+ _____ __ __ ____ _______ _______
+ / ____| \/ |/ __ \__ __|__ __|
+ | (___ | \ / | | | | | | | |
+ \___ \| |\/| | | | | | | | |
+ ____) | | | | |__| | | | | |
+ |_____/|_| |_|\___\_\ |_| |_|
+
diff --git a/smqtt-bootstrap/src/main/resources/test.yaml b/smqtt-bootstrap/src/main/resources/test.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e4203080c7a10e0811258fd56cb1cf8b0f78465e
--- /dev/null
+++ b/smqtt-bootstrap/src/main/resources/test.yaml
@@ -0,0 +1,3 @@
+smqtt:
+ tcp:
+ port: 7000
\ No newline at end of file
diff --git a/smqtt-bootstrap/src/test/java/ClusterNode1.java b/smqtt-bootstrap/src/test/java/ClusterNode1.java
index 2a7206a0691da3fa14aa594b58844c8c5207a444..b4eee816775b80106f85a37e32b6a2177a0ec6f5 100644
--- a/smqtt-bootstrap/src/test/java/ClusterNode1.java
+++ b/smqtt-bootstrap/src/test/java/ClusterNode1.java
@@ -1,4 +1,6 @@
-import io.github.quickmsg.common.cluster.ClusterConfig;
+import ch.qos.logback.classic.Level;
+import io.github.quickmsg.common.config.AuthConfig;
+import io.github.quickmsg.common.config.BootstrapConfig;
import io.github.quickmsg.common.config.SslContext;
import io.github.quickmsg.core.Bootstrap;
@@ -9,31 +11,44 @@ public class ClusterNode1 {
public static void main(String[] args) throws InterruptedException {
Bootstrap bootstrap = Bootstrap.builder()
- .port(8555)
- .websocketPort(8999)
- .options(channelOptionMap -> {
- })//netty options设置
- .childOptions(channelOptionMap -> {
- }) //netty childOptions设置
- .highWaterMark(1000000)
- .reactivePasswordAuth((U, P) -> true)
- .lowWaterMark(1000)
- .ssl(false)
- .sslContext(new SslContext("crt", "key"))
- .isWebsocket(true)
- .wiretap(false)
- .httpOptions(Bootstrap.HttpOptions.builder().ssl(false).accessLog(true).build())
+ .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(true)
+ .accessLog(true)
+ .admin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
+ .build())
.clusterConfig(
- ClusterConfig.builder()
- .clustered(false)
+ BootstrapConfig.
+ ClusterConfig
+ .builder()
+ .enable(true)
+ .namespace("smqtt")
+ .node("node-1")
.port(7773)
- .nodeName("node-2")
- .clusterUrl("127.0.0.1:7771,127.0.0.1:7772")
- .build())
+ .url("127.0.0.1:7771,127.0.0.1:7772").
+ build())
.build()
.start().block();
assert bootstrap != null;
- Thread.sleep(1000000);
+ Thread.sleep(10000000);
}
}
diff --git a/smqtt-bootstrap/src/test/java/ClusterNode2.java b/smqtt-bootstrap/src/test/java/ClusterNode2.java
index 3b04b86205bf8f9b6be63cfd6d00ac3e43891b10..a5a650724c26d3827bd2ff015718cc6d8f926640 100644
--- a/smqtt-bootstrap/src/test/java/ClusterNode2.java
+++ b/smqtt-bootstrap/src/test/java/ClusterNode2.java
@@ -1,5 +1,5 @@
-import io.github.quickmsg.common.cluster.ClusterConfig;
-import io.github.quickmsg.common.config.SslContext;
+import ch.qos.logback.classic.Level;
+import io.github.quickmsg.common.config.BootstrapConfig;
import io.github.quickmsg.core.Bootstrap;
/**
@@ -11,22 +11,25 @@ public class ClusterNode2 {
@org.junit.Test
public void startServer() throws InterruptedException {
+
Bootstrap bootstrap = Bootstrap.builder()
- .port(8556)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .lowWaterMark(1000)
- .reactivePasswordAuth((U,P)->true)
- .ssl(false)
- .wiretap(true)
+ .rootLevel(Level.DEBUG)
+ .tcpConfig(
+ BootstrapConfig
+ .TcpConfig
+ .builder()
+ .port(8551)
+ .build())
.clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
+ BootstrapConfig.
+ ClusterConfig
+ .builder()
+ .enable(true)
+ .node("node-3")
+ .namespace("smqtt")
.port(7772)
- .nodeName("node-3")
- .clusterUrl("127.0.0.1:7771,127.0.0.1:7773")
- .build())
+ .url("127.0.0.1:7773,127.0.0.1:7771").
+ build())
.build()
.start().block();
assert bootstrap != null;
diff --git a/smqtt-bootstrap/src/test/java/ClusterNode3.java b/smqtt-bootstrap/src/test/java/ClusterNode3.java
index cc92d7ffe2c187b7e5639c81a1bf831509705a4f..a9fea2c9eee7053a1815b16c31a01964baef31a6 100644
--- a/smqtt-bootstrap/src/test/java/ClusterNode3.java
+++ b/smqtt-bootstrap/src/test/java/ClusterNode3.java
@@ -1,4 +1,5 @@
-import io.github.quickmsg.common.cluster.ClusterConfig;
+import ch.qos.logback.classic.Level;
+import io.github.quickmsg.common.config.BootstrapConfig;
import io.github.quickmsg.core.Bootstrap;
/**
@@ -10,22 +11,25 @@ public class ClusterNode3 {
@org.junit.Test
public void startServer() throws InterruptedException {
+
Bootstrap bootstrap = Bootstrap.builder()
- .port(8551)
- .options(channelOptionMap -> {})//netty options设置
- .childOptions(channelOptionMap ->{}) //netty childOptions设置
- .highWaterMark(1000000)
- .reactivePasswordAuth((U,P)->true)
- .lowWaterMark(1000)
- .ssl(false)
- .wiretap(true)
+ .rootLevel(Level.DEBUG)
+ .tcpConfig(
+ BootstrapConfig
+ .TcpConfig
+ .builder()
+ .port(8553)
+ .build())
.clusterConfig(
- ClusterConfig.builder()
- .clustered(true)
+ BootstrapConfig.
+ ClusterConfig
+ .builder()
+ .enable(true)
+ .node("node-4")
.port(7771)
- .nodeName("node-4")
- .clusterUrl("127.0.0.1:7772,127.0.0.1:7773")
- .build())
+ .namespace("smqtt")
+ .url("127.0.0.1:7773,127.0.0.1:7772").
+ build())
.build()
.start().block();
assert bootstrap != null;
diff --git a/smqtt-bootstrap/src/test/java/topic/TopicTest.java b/smqtt-bootstrap/src/test/java/topic/TopicTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..d67f144ae17d85e0859923faf7a3bdae6390556d
--- /dev/null
+++ b/smqtt-bootstrap/src/test/java/topic/TopicTest.java
@@ -0,0 +1,53 @@
+package topic;
+
+import io.github.quickmsg.common.channel.MqttChannel;
+import io.github.quickmsg.common.topic.SubscribeTopic;
+import io.github.quickmsg.common.topic.TopicRegistry;
+import io.github.quickmsg.core.spi.DefaultTopicRegistry;
+import io.netty.handler.codec.mqtt.MqttQoS;
+
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.*;
+
+/**
+ * @author luxurong
+ */
+public class TopicTest {
+
+ static ExecutorService service = Executors.newFixedThreadPool(100);
+
+ private static TopicRegistry topicRegistry = new DefaultTopicRegistry();
+
+ private static Map channelMap = new ConcurrentHashMap<>();
+
+ public static void main(String[] args) {
+ CountDownLatch count = new CountDownLatch(500000);
+ for(int i=0;i<500000;i++){
+ service.execute(()->{
+ int index = new Random().nextInt(1000);
+ MqttChannel mqttChannel =channelMap.computeIfAbsent(index,in->{
+ MqttChannel mqttChannel1=new MqttChannel();
+ mqttChannel1.setTopics(new CopyOnWriteArraySet<>());
+ return mqttChannel1;
+ });
+ SubscribeTopic subscribeTopic=new SubscribeTopic(String.valueOf(index), MqttQoS.AT_MOST_ONCE,mqttChannel);
+ topicRegistry.registrySubscribeTopic(subscribeTopic);
+ topicRegistry.getAllTopics();
+ count.countDown();
+ });
+ }
+ try {
+ count.await();
+ Map> topics = topicRegistry.getAllTopics();
+ System.out.println(topics);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+}
diff --git a/smqtt-common/pom.xml b/smqtt-common/pom.xml
index 0860e1da4120a1476c05640fab8d030139c735b7..c8e804ea27958dbe3c42810b43fa61ea96772777 100644
--- a/smqtt-common/pom.xml
+++ b/smqtt-common/pom.xml
@@ -5,7 +5,7 @@
smqtt
io.github.quickmsg
- 1.0.5
+ 1.1.7
4.0.0
jar
@@ -14,13 +14,17 @@
smqtt-common
- http://www.example.com
+ https://doc.smqtt.cc/
- com.alibaba
- fastjson
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-properties
io.projectreactor.netty
@@ -51,5 +55,45 @@
ch.qos.logback
logback-classic
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jdk8
+
+
+ io.micrometer
+ micrometer-core
+
+
+ com.github.oshi
+ oshi-core
+
+
+ io.micrometer
+ micrometer-registry-prometheus
+
+
+ io.micrometer
+ micrometer-registry-influx
+
+
+ org.casbin
+ jcasbin
+
+
+ org.casbin
+ jdbc-adapter
+
diff --git a/smqtt-common/pom.xml.versionsBackup b/smqtt-common/pom.xml.versionsBackup
new file mode 100644
index 0000000000000000000000000000000000000000..0cc543f7b89c5760e853f3e3314488633889d2df
--- /dev/null
+++ b/smqtt-common/pom.xml.versionsBackup
@@ -0,0 +1,55 @@
+
+
+
+
+ smqtt
+ com.github.quickmsg.smqtt
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ jar
+
+ smqtt-common
+
+ smqtt-common
+
+ http://www.example.com
+
+
+
+
+ com.alibaba
+ fastjson
+
+
+ io.projectreactor.netty
+ reactor-netty
+
+
+ io.netty
+ netty-codec-mqtt
+
+
+ org.projectlombok
+ lombok
+
+
+ junit
+ junit
+ test
+
+
+ org.slf4j
+ slf4j-api
+
+
+ ch.qos.logback
+ logback-core
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
diff --git a/smqtt-common/src/main/java/io/github/quickmsg/common/StartUp.java b/smqtt-common/src/main/java/io/github/quickmsg/common/StartUp.java
index 1141f177019e7d191c486fb1d6b9b2af77af1888..74aed10a735dee73eb8c1a49171049a1fd77c63a 100644
--- a/smqtt-common/src/main/java/io/github/quickmsg/common/StartUp.java
+++ b/smqtt-common/src/main/java/io/github/quickmsg/common/StartUp.java
@@ -1,6 +1,6 @@
package io.github.quickmsg.common;
-import io.github.quickmsg.common.environment.EnvContext;
+import java.util.Map;
/**
* @author luxurong
@@ -11,9 +11,10 @@ public interface StartUp {
/**
* 注入环境变量
*
- * @param envContext 环境变量
+ * @param environmentMap 注入不同配置
+ * @see io.github.quickmsg.common.config.BootstrapConfig
*/
- default void startUp(EnvContext envContext) {
+ default void startUp(Map