提交 d77ea794 编写于 作者: 1ssqq1lxr's avatar 1ssqq1lxr

springboot

上级 d52f29ab
......@@ -22,7 +22,7 @@ SMQTT基于Netty开发,底层采用Reactor3反应堆模型,支持单机部署
6. tls加密
- 支持tls加密(mqtt端口/http端口)
7. websocket协议支持x
> 使用websocket协议包装mqtt协议
> 使用mqtt over websocket
8. http协议交互
- 支持http接口推送消息
- 支持spi扩展http接口
......@@ -36,7 +36,7 @@ SMQTT基于Netty开发,底层采用Reactor3反应堆模型,支持单机部署
> 默认镜像最新tag: 1ssqq1lxr/smqtt
12. 持久化支持(session 保留消息)
13. 规则引擎支持(文档需要赞助提供)
14. 支持springboot starter容器化
14. 支持springboot starter启动
15. 管理后台
> 请参考smqtt文档如何启动管理后台
......
......@@ -8,42 +8,41 @@ sort: 1
1. 构建`BootstrapConfig.ClusterConfig`参数
```
Bootstrap.builder()
.rootLevel(Level.DEBUG)
.clusterConfig(
BootstrapConfig.ClusterConfig
.builder()
.enable(true)
.namespace("smqtt")
.node("node-1")
.port(7773)
.url("127.0.0.1:7771,127.0.0.1:7772")
. build())
.build()
.startAwait();
```
`Bootstrap.ClusterConfig`参数:
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动http |否 |false |
| namespace |命名空间 |否 |smqtt |
| node | 节点名称,必须唯一 | 是|无 |
| port | 端口号|是|无|
| url | cluster初始化节点||无|
2. 启动Bootstrap时候设置 `BootstrapConfig.ClusterConfig`
```
Bootstrap bootstrap = Bootstrap.builder()
.rootLevel(Level.DEBUG)
.clusterConfig(BootstrapConfig.ClusterConfig)
.build()
.startAwait();
```
```
Bootstrap.builder()
.rootLevel(Level.DEBUG)
.clusterConfig(
BootstrapConfig.ClusterConfig
.builder()
.enable(true)
.namespace("smqtt")
.node("node-1")
.port(7773)
.url("127.0.0.1:7771,127.0.0.1:7772")
. build())
.build()
.startAwait();
```
`Bootstrap.ClusterConfig`参数:
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动http |否 |false |
| namespace |命名空间 |否 |smqtt |
| node | 节点名称,必须唯一 | 是|无 |
| port | 端口号|是|无|
| url | cluster初始化节点||无|
2. 启动Bootstrap时候设置 `BootstrapConfig.ClusterConfig`
```
Bootstrap bootstrap = Bootstrap.builder()
.rootLevel(Level.DEBUG)
.clusterConfig(BootstrapConfig.ClusterConfig)
.build()
.startAwait();
```
## 配置文件启动(docker,jar,springboot)
......
......@@ -18,23 +18,22 @@ sort: 1
.build()
```
`Bootstrap.HttpConfig`参数:
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动http |否 |false |
| accessLog | http日志 |否 |false |
| admin | http后台管理配置 | 否|无 |
| ssl | ssl配置|否|参考ssl配置参数|
BootstrapConfig.HttpAdmin参数
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动后台管理 |否 |false |
| username | 登陆用户名 |否 |smqtt |
| password | 登陆密码 | 否|smqtt |
`Bootstrap.HttpConfig`参数:
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动http |否 |false |
| accessLog | http日志 |否 |false |
| admin | http后台管理配置 | 否|无 |
| ssl | ssl配置|否|参考ssl配置参数|
BootstrapConfig.HttpAdmin参数
| 参数 | 说明 | 必传 |默认值 |
| ---- | ---- |---- |---- |
| enable | 启动后台管理 |否 |false |
| username | 登陆用户名 |否 |smqtt |
| password | 登陆密码 | 否|smqtt |
2. 启动Bootstrap时候设置 `BootstrapConfig.HttpConfig`
......
......@@ -5,12 +5,8 @@ sort: 3
# main启动
## main启动
2. 启动服务:
- 阻塞启动
```markdown
## 阻塞启动
```markdown
Bootstrap bootstrap = Bootstrap.builder()
.rootLevel(Level.DEBUG)
......@@ -43,40 +39,38 @@ sort: 3
.build()
.startAwait();
```
- 非阻塞启动
```markdown
Bootstrap bootstrap = Bootstrap.builder()
.rootLevel(Level.DEBUG)
.tcpConfig(
BootstrapConfig
.TcpConfig
.builder()
.port(8888)
.username("smqtt")
.password("smqtt")
.build())
.httpConfig(
BootstrapConfig
.HttpConfig
.builder()
.enable(true)
.accessLog(true)
.httpAdmin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
.build())
.clusterConfig(
BootstrapConfig.
ClusterConfig
.builder()
.enable(true)
.namespace("smqtt")
.node("node-1")
.port(7773)
.url("127.0.0.1:7771,127.0.0.1:7772").
build())
.build()
.start().block();
```
## 非阻塞启动
```markdown
Bootstrap bootstrap = Bootstrap.builder()
.rootLevel(Level.DEBUG)
.tcpConfig(
BootstrapConfig
.TcpConfig
.builder()
.port(8888)
.username("smqtt")
.password("smqtt")
.build())
.httpConfig(
BootstrapConfig
.HttpConfig
.builder()
.enable(true)
.accessLog(true)
.httpAdmin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
.build())
.clusterConfig(
BootstrapConfig.
ClusterConfig
.builder()
.enable(true)
.namespace("smqtt")
.node("node-1")
.port(7773)
.url("127.0.0.1:7771,127.0.0.1:7772").
build())
.build()
.start().block();
```
\ No newline at end of file
```
\ No newline at end of file
......@@ -29,10 +29,6 @@ sort: 1
.build()
.startAwait();
```
2. 启动Bootstrap时候设置 `BootstrapConfig.WebsocketConfig`
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册