消费改造
This commit is contained in:
@@ -29,15 +29,12 @@ public class MqttConnectStatusListener2 implements IMqttConnectStatusListener {
|
|||||||
@Override
|
@Override
|
||||||
public void online(ChannelContext context, String clientId, String username) {
|
public void online(ChannelContext context, String clientId, String username) {
|
||||||
//设备上线不做任何处理,只有心跳报文做处理
|
//设备上线不做任何处理,只有心跳报文做处理
|
||||||
log.info("online-context: {}", context);
|
|
||||||
log.info("设备:{}上线", clientId);
|
log.info("设备:{}上线", clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void offline(ChannelContext context, String clientId, String username, String reason) {
|
public void offline(ChannelContext context, String clientId, String username, String reason) {
|
||||||
log.info("offline-context: {}", context);
|
|
||||||
redisService.deleteObject(CacheConstants.EQUIPMENT_HEARTBEAT + clientId);
|
|
||||||
log.info("设备:{}离线,offline reason:{}.", clientId, reason);
|
log.info("设备:{}离线,offline reason:{}.", clientId, reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ spring:
|
|||||||
name: mica-mqtt-server
|
name: mica-mqtt-server
|
||||||
# 环境 dev|test|prod
|
# 环境 dev|test|prod
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
# active: dev
|
||||||
# active: prod
|
active: prod
|
||||||
messages:
|
messages:
|
||||||
encoding: UTF-8
|
encoding: UTF-8
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
<gson.version>2.13.2</gson.version>
|
<gson.version>2.13.2</gson.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>mqtt-xf-receiver</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- 使用 Spring Boot 3 的依赖管理 -->
|
<!-- 使用 Spring Boot 3 的依赖管理 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user