review:【IoT 物联网】为 EMQX 协议添加 共享 的 Vertx
This commit is contained in:
parent
18c27196f1
commit
d783890b7c
@ -31,7 +31,7 @@ public class IotEmqxUpstreamProtocol {
|
|||||||
|
|
||||||
private volatile boolean isRunning = false;
|
private volatile boolean isRunning = false;
|
||||||
|
|
||||||
private Vertx vertx;
|
private final Vertx vertx;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String serverId;
|
private final String serverId;
|
||||||
|
|||||||
@ -79,6 +79,7 @@ public class IotEmqxDownstreamHandler {
|
|||||||
// 2. 根据消息方法和回复状态,构建 topic
|
// 2. 根据消息方法和回复状态,构建 topic
|
||||||
boolean isReply = IotDeviceMessageUtils.isReplyMessage(message);
|
boolean isReply = IotDeviceMessageUtils.isReplyMessage(message);
|
||||||
|
|
||||||
|
// TODO @芋艿:看看基于 message 的 method 去反向推导;
|
||||||
// 3. 根据消息方法类型构建对应的主题
|
// 3. 根据消息方法类型构建对应的主题
|
||||||
switch (methodEnum) {
|
switch (methodEnum) {
|
||||||
case PROPERTY_POST:
|
case PROPERTY_POST:
|
||||||
@ -96,6 +97,7 @@ public class IotEmqxDownstreamHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_POST:
|
case EVENT_POST:
|
||||||
|
// TODO @haohao:不用 eventIdentifier 拼接哈,直接 data 里面,有 identifier 字段
|
||||||
// 事件上报:只支持回复消息(下行)
|
// 事件上报:只支持回复消息(下行)
|
||||||
if (isReply) {
|
if (isReply) {
|
||||||
String identifier = IotDeviceMessageUtils.getIdentifier(message);
|
String identifier = IotDeviceMessageUtils.getIdentifier(message);
|
||||||
@ -107,6 +109,7 @@ public class IotEmqxDownstreamHandler {
|
|||||||
|
|
||||||
case SERVICE_INVOKE:
|
case SERVICE_INVOKE:
|
||||||
// 服务调用:支持请求和回复
|
// 服务调用:支持请求和回复
|
||||||
|
// TODO @haohao:不用 serviceIdentifier 拼接哈,直接 data 里面,有 identifier 字段
|
||||||
String serviceIdentifier = IotDeviceMessageUtils.getIdentifier(message);
|
String serviceIdentifier = IotDeviceMessageUtils.getIdentifier(message);
|
||||||
if (StrUtil.isNotBlank(serviceIdentifier)) {
|
if (StrUtil.isNotBlank(serviceIdentifier)) {
|
||||||
if (isReply) {
|
if (isReply) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user