Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mica
mica-mqtt
提交
180f9359
mica-mqtt
项目概览
mica
/
mica-mqtt
通知
71
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
mica-mqtt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
180f9359
编写于
9月 09, 2021
作者:
如梦技术
🐛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
测试 mica-mqtt-broker。
上级
d5500251
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
152 addition
and
2 deletion
+152
-2
mica-mqtt-broker/src/main/java/net/dreamlu/iot/mqtt/broker/config/MqttBrokerConfiguration.java
...eamlu/iot/mqtt/broker/config/MqttBrokerConfiguration.java
+7
-0
mica-mqtt-broker/src/main/resources/application-dev.yml
mica-mqtt-broker/src/main/resources/application-dev.yml
+2
-2
mica-mqtt-broker/src/test/java/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication1.java
...a/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication1.java
+39
-0
mica-mqtt-broker/src/test/java/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication2.java
...a/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication2.java
+38
-0
mica-mqtt-broker/src/test/resources/application-dev1.yml
mica-mqtt-broker/src/test/resources/application-dev1.yml
+20
-0
mica-mqtt-broker/src/test/resources/application-dev2.yml
mica-mqtt-broker/src/test/resources/application-dev2.yml
+20
-0
mica-mqtt-broker/src/test/resources/application.yml
mica-mqtt-broker/src/test/resources/application.yml
+26
-0
未找到文件。
mica-mqtt-broker/src/main/java/net/dreamlu/iot/mqtt/broker/config/MqttBrokerConfiguration.java
浏览文件 @
180f9359
...
...
@@ -18,12 +18,14 @@ package net.dreamlu.iot.mqtt.broker.config;
import
net.dreamlu.iot.mqtt.broker.cluster.RedisMqttMessageDispatcher
;
import
net.dreamlu.iot.mqtt.broker.cluster.RedisMqttMessageReceiver
;
import
net.dreamlu.iot.mqtt.broker.cluster.RedisMqttMessageStore
;
import
net.dreamlu.iot.mqtt.broker.enums.RedisKeys
;
import
net.dreamlu.iot.mqtt.broker.listener.MqttBrokerConnectListener
;
import
net.dreamlu.iot.mqtt.broker.listener.MqttBrokerMessageListener
;
import
net.dreamlu.iot.mqtt.core.server.MqttServer
;
import
net.dreamlu.iot.mqtt.core.server.dispatcher.IMqttMessageDispatcher
;
import
net.dreamlu.iot.mqtt.core.server.event.IMqttConnectStatusListener
;
import
net.dreamlu.iot.mqtt.core.server.store.IMqttMessageStore
;
import
net.dreamlu.mica.redis.cache.MicaRedisCache
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -41,6 +43,11 @@ public class MqttBrokerConfiguration {
return
new
MqttBrokerConnectListener
(
redisCache
,
RedisKeys
.
CONNECT_STATUS
.
getKey
());
}
@Bean
public
IMqttMessageStore
mqttMessageStore
(
MicaRedisCache
redisCache
)
{
return
new
RedisMqttMessageStore
(
redisCache
);
}
@Bean
public
RedisMqttMessageReceiver
mqttMessageReceiver
(
MicaRedisCache
redisCache
,
MqttServer
mqttServer
)
{
...
...
mica-mqtt-broker/src/main/resources/application-dev.yml
浏览文件 @
180f9359
...
...
@@ -2,13 +2,13 @@ mqtt:
server
:
enabled
:
true
# 是否开启服务端,默认:true
# ip: 0.0.0.0 # 服务端 ip 默认为空,0.0.0.0
port
:
5
883
# 端口,默认:1883
port
:
1
883
# 端口,默认:1883
name
:
Mica-Mqtt-Server
# 名称,默认:Mica-Mqtt-Server
buffer-allocator
:
HEAP
# 堆内存和堆外内存,默认:堆内存
heartbeat-timeout
:
120000
# 心跳超时,单位毫秒,默认: 1000 * 120
read-buffer-size
:
8092
# 接收数据的 buffer size,默认:8092
max-bytes-in-message
:
8092
# 消息解析最大 bytes 长度,默认:8092
debug
:
true
# 如果开启 prometheus 指标收集建议关闭
debug
:
true
# 如果开启 prometheus 指标收集
,
建议关闭
web-port
:
8083
# http、websocket 端口,默认:8083
websocket-enable
:
true
# 是否开启 websocket,默认: true
http-enable
:
false
# 是否开启 http api,默认: false
...
...
mica-mqtt-broker/src/test/java/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication1.java
0 → 100644
浏览文件 @
180f9359
/*
* Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & dreamlu.net).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
net.dreamlu.iot.mqtt.broker
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
java.util.Properties
;
/**
* mica mqtt broker
*
* @author L.cm
*/
@SpringBootApplication
public
class
MqttBrokerApplication1
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
application
=
new
SpringApplication
(
MqttBrokerApplication1
.
class
);
application
.
setAdditionalProfiles
(
"dev1"
);
application
.
run
(
args
);
}
}
mica-mqtt-broker/src/test/java/net/dreamlu/iot/mqtt/broker/MqttBrokerApplication2.java
0 → 100644
浏览文件 @
180f9359
/*
* Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & dreamlu.net).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
net.dreamlu.iot.mqtt.broker
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
java.util.Properties
;
/**
* mica mqtt broker
*
* @author L.cm
*/
@SpringBootApplication
public
class
MqttBrokerApplication2
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
application
=
new
SpringApplication
(
MqttBrokerApplication1
.
class
);
application
.
setAdditionalProfiles
(
"dev2"
);
application
.
run
(
args
);
}
}
mica-mqtt-broker/src/test/resources/application-dev1.yml
0 → 100644
浏览文件 @
180f9359
server
:
port
:
30002
mqtt
:
server
:
enabled
:
true
# 是否开启服务端,默认:true
# ip: 0.0.0.0 # 服务端 ip 默认为空,0.0.0.0
port
:
2883
# 端口,默认:1883
name
:
Mica-Mqtt-Server
# 名称,默认:Mica-Mqtt-Server
buffer-allocator
:
HEAP
# 堆内存和堆外内存,默认:堆内存
heartbeat-timeout
:
120000
# 心跳超时,单位毫秒,默认: 1000 * 120
read-buffer-size
:
8092
# 接收数据的 buffer size,默认:8092
max-bytes-in-message
:
8092
# 消息解析最大 bytes 长度,默认:8092
debug
:
true
# 如果开启 prometheus 指标收集,建议关闭
web-port
:
28083
# http、websocket 端口,默认:8083
websocket-enable
:
true
# 是否开启 websocket,默认: true
http-enable
:
false
# 是否开启 http api,默认: false
http-basic-auth
:
enable
:
false
# 是否开启 http basic auth,默认: false
username
:
"
mica"
# http basic auth 用户名
password
:
"
mica"
# http basic auth 密码
mica-mqtt-broker/src/test/resources/application-dev2.yml
0 → 100644
浏览文件 @
180f9359
server
:
port
:
30003
mqtt
:
server
:
enabled
:
true
# 是否开启服务端,默认:true
# ip: 0.0.0.0 # 服务端 ip 默认为空,0.0.0.0
port
:
3883
# 端口,默认:1883
name
:
Mica-Mqtt-Server
# 名称,默认:Mica-Mqtt-Server
buffer-allocator
:
HEAP
# 堆内存和堆外内存,默认:堆内存
heartbeat-timeout
:
120000
# 心跳超时,单位毫秒,默认: 1000 * 120
read-buffer-size
:
8092
# 接收数据的 buffer size,默认:8092
max-bytes-in-message
:
8092
# 消息解析最大 bytes 长度,默认:8092
debug
:
true
# 如果开启 prometheus 指标收集,建议关闭
web-port
:
38083
# http、websocket 端口,默认:8083
websocket-enable
:
true
# 是否开启 websocket,默认: true
http-enable
:
false
# 是否开启 http api,默认: false
http-basic-auth
:
enable
:
false
# 是否开启 http basic auth,默认: false
username
:
"
mica"
# http basic auth 用户名
password
:
"
mica"
# http basic auth 密码
mica-mqtt-broker/src/test/resources/application.yml
0 → 100644
浏览文件 @
180f9359
spring
:
application
:
name
:
mica-mqtt-broker
# actuator management
management
:
info
:
defaults
:
enabled
:
true
metrics
:
tags
:
application
:
${spring.application.name}
endpoint
:
health
:
show-details
:
ALWAYS
prometheus
:
enabled
:
true
endpoints
:
web
:
exposure
:
include
:
'
*'
# 日志配置
logging
:
level
:
root
:
info
server
:
info
# t-io 服务端默认日志
org.tio
:
info
# t-io 服务端默认日志
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录