Merge branch 'feature'
commit
db8907956f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -5,7 +5,7 @@
|
|||
"name": "MQTT标准协议组件",
|
||||
"type": "device",
|
||||
"protocol": "mqtt",
|
||||
"jarFile": "iot-mqtt-component-0.4.0-SNAPSHOT.jar",
|
||||
"jarFile": "iot-mqtt-component-0.4.2-SNAPSHOT.jar",
|
||||
"config": "{\"port\":1883,\"ssl\":false,\"type\":\"server\"}",
|
||||
"converter": "6260396d67aced2696184053",
|
||||
"state": "running",
|
||||
|
@ -17,7 +17,7 @@
|
|||
"name": "EMQX标准协议组件",
|
||||
"type": "device",
|
||||
"protocol": "mqtt",
|
||||
"jarFile": "iot-emqx-component-0.4.0-SNAPSHOT.jar",
|
||||
"jarFile": "iot-emqx-component-0.4.2-SNAPSHOT.jar",
|
||||
"config": "{\"port\":\"1884\",\"ssl\":false,\"type\":\"client\",\"subscribeTopics\":[\"/sys/+/+/s/#\",\"/sys/client/connected\",\"/sys/client/disconnected\",\"/sys/session/subscribed\",\"/sys/session/unsubscribed\"],\"authPort\":\"8088\",\"broker\":\"127.0.0.1\",\"clientId\":\"test\",\"username\":\"test\",\"password\":\"123\"}",
|
||||
"converter": "6260396d67aced2696184053",
|
||||
"state": "stopped",
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "小度音箱接入组件",
|
||||
"type": "biz",
|
||||
"protocol": "http",
|
||||
"jarFile": "iot-http-biz-component-0.4.0-SNAPSHOT.jar",
|
||||
"jarFile": "iot-http-biz-component-0.4.2-SNAPSHOT.jar",
|
||||
"config": "{\"port\":\"8084\"}",
|
||||
"converter": "",
|
||||
"state": "stopped",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -12,10 +12,14 @@ package cc.iotkit.comp;
|
|||
import cc.iotkit.comp.model.ReceiveResult;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public interface IMessageHandler {
|
||||
|
||||
ReceiveResult onReceive(Map<String, Object> head, String type, String msg);
|
||||
void onReceive(Map<String, Object> head, String type, String msg);
|
||||
|
||||
void onReceive(Map<String, Object> head, String type, String msg, Consumer<ReceiveResult> onResult);
|
||||
|
||||
/**
|
||||
* 添加脚本环境变量
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -32,6 +32,8 @@ import org.apache.commons.beanutils.BeanUtils;
|
|||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Slf4j
|
||||
@Data
|
||||
|
@ -50,6 +52,10 @@ public class DeviceMessageHandler implements IMessageHandler {
|
|||
|
||||
private final DeviceRouter deviceRouter;
|
||||
|
||||
private final ExecutorService executorService = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
|
||||
60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<>());
|
||||
|
||||
@SneakyThrows
|
||||
public DeviceMessageHandler(DeviceComponentManager deviceComponentManager,
|
||||
IDeviceComponent component,
|
||||
|
@ -67,64 +73,78 @@ public class DeviceMessageHandler implements IMessageHandler {
|
|||
scriptObj = engine.eval(String.format("new (function () {\n%s})()", script));
|
||||
}
|
||||
|
||||
public ReceiveResult onReceive(Map<String, Object> head, String type, String msg) {
|
||||
try {
|
||||
ScriptObjectMirror result = (ScriptObjectMirror) invokeMethod("onReceive", head, type, msg);
|
||||
log.info("onReceive script result:{}", JsonUtil.toJsonString(result));
|
||||
Object rstType = result.get("type");
|
||||
if (rstType == null) {
|
||||
return null;
|
||||
}
|
||||
//取脚本执行后返回的数据
|
||||
Object data = JsonUtil.toObject((ScriptObjectMirror) result.get("data"));
|
||||
if (!(data instanceof Map)) {
|
||||
throw new BizException("script result data is incorrect");
|
||||
}
|
||||
public void onReceive(Map<String, Object> head, String type, String msg) {
|
||||
onReceive(head, type, msg, (r) -> {
|
||||
});
|
||||
}
|
||||
|
||||
Map<String, Object> dataMap = (Map) data;
|
||||
//获取动作数据
|
||||
Action action = getAction(result.get("action"));
|
||||
|
||||
if ("register".equals(rstType)) {
|
||||
//注册数据
|
||||
RegisterInfo regInfo = RegisterInfo.from(dataMap);
|
||||
if (regInfo == null) {
|
||||
return null;
|
||||
public void onReceive(Map<String, Object> head, String type, String msg, Consumer<ReceiveResult> onResult) {
|
||||
executorService.submit(() -> {
|
||||
try {
|
||||
ScriptObjectMirror result = (ScriptObjectMirror) invokeMethod("onReceive", head, type, msg);
|
||||
log.info("onReceive script result:{}", JsonUtil.toJsonString(result));
|
||||
Object rstType = result.get("type");
|
||||
if (rstType == null) {
|
||||
onResult.accept(null);
|
||||
return;
|
||||
}
|
||||
doRegister(regInfo);
|
||||
doAction(action);
|
||||
return new ReceiveResult(regInfo.getProductKey(), regInfo.getDeviceName(), regInfo);
|
||||
} else if ("auth".equals(rstType)) {
|
||||
//设备认证
|
||||
AuthInfo authInfo = new AuthInfo();
|
||||
BeanUtils.populate(authInfo, dataMap);
|
||||
doAuth(authInfo);
|
||||
doAction(action);
|
||||
return new ReceiveResult(authInfo.getProductKey(), authInfo.getDeviceName(), authInfo);
|
||||
} else if ("state".equals(rstType)) {
|
||||
//设备状态变更
|
||||
DeviceState state = DeviceState.from(dataMap);
|
||||
if (state == null) {
|
||||
return null;
|
||||
//取脚本执行后返回的数据
|
||||
Object data = JsonUtil.toObject((ScriptObjectMirror) result.get("data"));
|
||||
if (!(data instanceof Map)) {
|
||||
throw new BizException("script result data is incorrect");
|
||||
}
|
||||
doStateChange(state);
|
||||
doAction(action);
|
||||
return new ReceiveResult(state.getProductKey(), state.getDeviceName(), state);
|
||||
} else if ("report".equals(rstType)) {
|
||||
//上报数据
|
||||
DeviceMessage message = new DeviceMessage();
|
||||
BeanUtils.populate(message, dataMap);
|
||||
doReport(message);
|
||||
doAction(action);
|
||||
return new ReceiveResult(message.getProductKey(), message.getDeviceName(), message);
|
||||
}
|
||||
|
||||
} catch (BizException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
throw new BizException("receive component message error", e);
|
||||
}
|
||||
return null;
|
||||
Map<String, Object> dataMap = (Map) data;
|
||||
//获取动作数据
|
||||
Action action = getAction(result.get("action"));
|
||||
|
||||
if ("register".equals(rstType)) {
|
||||
//注册数据
|
||||
RegisterInfo regInfo = RegisterInfo.from(dataMap);
|
||||
if (regInfo == null) {
|
||||
onResult.accept(null);
|
||||
return;
|
||||
}
|
||||
doRegister(regInfo);
|
||||
doAction(action);
|
||||
onResult.accept(new ReceiveResult(regInfo.getProductKey(), regInfo.getDeviceName(), regInfo));
|
||||
return;
|
||||
} else if ("auth".equals(rstType)) {
|
||||
//设备认证
|
||||
AuthInfo authInfo = new AuthInfo();
|
||||
BeanUtils.populate(authInfo, dataMap);
|
||||
doAuth(authInfo);
|
||||
doAction(action);
|
||||
onResult.accept(new ReceiveResult(authInfo.getProductKey(), authInfo.getDeviceName(), authInfo));
|
||||
return;
|
||||
} else if ("state".equals(rstType)) {
|
||||
//设备状态变更
|
||||
DeviceState state = DeviceState.from(dataMap);
|
||||
if (state == null) {
|
||||
onResult.accept(null);
|
||||
return;
|
||||
}
|
||||
doStateChange(state);
|
||||
doAction(action);
|
||||
onResult.accept(new ReceiveResult(state.getProductKey(), state.getDeviceName(), state));
|
||||
return;
|
||||
} else if ("report".equals(rstType)) {
|
||||
//上报数据
|
||||
DeviceMessage message = new DeviceMessage();
|
||||
BeanUtils.populate(message, dataMap);
|
||||
doReport(message);
|
||||
doAction(action);
|
||||
onResult.accept(new ReceiveResult(message.getProductKey(), message.getDeviceName(), message));
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (BizException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
throw new BizException("receive component message error", e);
|
||||
}
|
||||
onResult.accept(null);
|
||||
});
|
||||
}
|
||||
|
||||
private void doRegister(RegisterInfo reg) throws ScriptException, NoSuchMethodException {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package cc.iotkit.comps;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MessageInfo {
|
||||
private Map<String, Object> head;
|
||||
private String type;
|
||||
private String msg;
|
||||
}
|
|
@ -1,15 +1,9 @@
|
|||
package cc.iotkit.comps.config;
|
||||
|
||||
import cc.iotkit.model.device.message.ThingModelMessage;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import cc.iotkit.mq.vertx.VertxMqConsumer;
|
||||
import cc.iotkit.mq.vertx.VertxMqProducer;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -41,16 +35,5 @@ public class ComponentConfig {
|
|||
return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
||||
}
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqProducer<ThingModelMessage> getThingModelMessageProducer() {
|
||||
return new VertxMqProducer<>(ThingModelMessage.class);
|
||||
}
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqConsumer<ThingModelMessage> getThingModelMessageConsumer() {
|
||||
return new VertxMqConsumer<>(ThingModelMessage.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>iot-emqx-component</artifactId>
|
||||
|
@ -84,25 +84,25 @@
|
|||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-model</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-common</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-component-base</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-data-service</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>iot-http-biz-component</artifactId>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-component-base</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>iot-mqtt-component</artifactId>
|
||||
|
@ -82,19 +82,19 @@
|
|||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-common</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-component-base</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-data-service</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-components</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -76,9 +76,11 @@ public class MqttVerticle extends AbstractVerticle {
|
|||
log.info("MQTT client auth,clientId:{},username:{},password:{}",
|
||||
clientId, auth.getUsername(), auth.getPassword());
|
||||
try {
|
||||
ReceiveResult result = executor.onReceive(new HashMap<>(), "auth", authJson);
|
||||
//保存设备与连接关系
|
||||
endpointMap.put(getEndpointKey(result), endpoint);
|
||||
executor.onReceive(new HashMap<>(), "auth", authJson, (r) -> {
|
||||
//保存设备与连接关系
|
||||
endpointMap.put(getEndpointKey(r), endpoint);
|
||||
});
|
||||
|
||||
} catch (Throwable e) {
|
||||
log.error("auth failed", e);
|
||||
endpoint.reject(MqttConnectReturnCode.CONNECTION_REFUSED_NOT_AUTHORIZED);
|
||||
|
@ -90,14 +92,16 @@ public class MqttVerticle extends AbstractVerticle {
|
|||
endpoint.accept(false);
|
||||
endpoint.closeHandler((v) -> {
|
||||
log.warn("client connection closed,clientId:{}", clientId);
|
||||
ReceiveResult result = executor.onReceive(new HashMap<>(), "disconnect", clientId);
|
||||
//删除设备与连接关系
|
||||
endpointMap.remove(getEndpointKey(result));
|
||||
executor.onReceive(new HashMap<>(), "disconnect", clientId, (r) -> {
|
||||
//删除设备与连接关系
|
||||
endpointMap.remove(getEndpointKey(r));
|
||||
});
|
||||
}).disconnectMessageHandler(disconnectMessage -> {
|
||||
log.info("Received disconnect from client, reason code = {}", disconnectMessage.code());
|
||||
ReceiveResult result = executor.onReceive(new HashMap<>(), "disconnect", clientId);
|
||||
//删除设备与连接关系
|
||||
endpointMap.remove(getEndpointKey(result));
|
||||
executor.onReceive(new HashMap<>(), "disconnect", clientId, (r) -> {
|
||||
//删除设备与连接关系
|
||||
endpointMap.remove(getEndpointKey(r));
|
||||
});
|
||||
}).subscribeHandler(subscribe -> {
|
||||
List<MqttSubAckReasonCode> reasonCodes = new ArrayList<>();
|
||||
for (MqttTopicSubscription s : subscribe.topicSubscriptions()) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.es.document;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -12,7 +12,7 @@ public class DbStructureDataImpl implements IDbStructureData {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void undefineThingModel(ThingModel thingModel) {
|
||||
public void updateThingModel(ThingModel thingModel) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>iot-model</artifactId>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>iot-rdb-data-service</artifactId>
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.data.service;
|
||||
|
||||
import cc.iotkit.data.IUserInfoData;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.data.service;
|
||||
|
||||
import cc.iotkit.data.IVirtualDeviceData;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
### 时序数据库服务接口的TDengine实现
|
||||
|
||||
版本:v0.4.1
|
||||
支持版本:v0.4.1
|
||||
|
||||
TDengine版本:2.6.0.12
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.config;
|
||||
|
||||
public interface Constants {
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.config;
|
||||
|
||||
import cc.iotkit.temporal.td.dao.TdTemplate;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dao;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dm;
|
||||
|
||||
import cc.iotkit.model.product.ThingModel;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dm;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dm;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dm;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.dm;
|
||||
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.temporal.td.service;
|
||||
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
|
@ -50,58 +59,65 @@ public class DbStructureDataImpl implements IDbStructureData {
|
|||
* 根据物模型更新超级表结构
|
||||
*/
|
||||
@Override
|
||||
public void undefineThingModel(ThingModel thingModel) {
|
||||
//获取旧字段信息
|
||||
String tbName = Constants.getProductPropertySTableName(thingModel.getProductKey());
|
||||
String sql = TableManager.getDescTableSql(tbName);
|
||||
TdResponse response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("get des table error:" + JsonUtil.toJsonString(response));
|
||||
}
|
||||
|
||||
List<TdField> oldFields = FieldParser.parse(response.getData());
|
||||
List<TdField> newFields = FieldParser.parse(thingModel);
|
||||
//对比差异
|
||||
|
||||
//找出新增的字段
|
||||
List<TdField> addFields = newFields.stream().filter((f) -> oldFields.stream()
|
||||
.noneMatch(old -> old.getName().equals(f.getName())))
|
||||
.collect(Collectors.toList());
|
||||
if (addFields.size() > 0) {
|
||||
sql = TableManager.getAddSTableColumnSql(tbName, addFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
public void updateThingModel(ThingModel thingModel) {
|
||||
try {
|
||||
//获取旧字段信息
|
||||
String tbName = Constants.getProductPropertySTableName(thingModel.getProductKey());
|
||||
String sql = TableManager.getDescTableSql(tbName);
|
||||
TdResponse response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("add table column error:" + JsonUtil.toJsonString(response));
|
||||
throw new RuntimeException("get des table error:" + JsonUtil.toJsonString(response));
|
||||
}
|
||||
}
|
||||
|
||||
//找出修改的字段
|
||||
List<TdField> modifyFields = newFields.stream().filter((f) -> oldFields.stream()
|
||||
.anyMatch(old ->
|
||||
old.getName().equals(f.getName()) //字段名相同
|
||||
//字段类型或长度不同
|
||||
&& (old.getType().equals(f.getType()) || old.getLength() != f.getLength())
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
List<TdField> oldFields = FieldParser.parse(response.getData());
|
||||
List<TdField> newFields = FieldParser.parse(thingModel);
|
||||
//对比差异
|
||||
|
||||
if (modifyFields.size() > 0) {
|
||||
sql = TableManager.getModifySTableColumnSql(tbName, modifyFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("modify table column error:" + JsonUtil.toJsonString(response));
|
||||
//找出新增的字段
|
||||
List<TdField> addFields = newFields.stream().filter((f) -> oldFields.stream()
|
||||
.noneMatch(old -> old.getName().equals(f.getName())))
|
||||
.collect(Collectors.toList());
|
||||
if (addFields.size() > 0) {
|
||||
sql = TableManager.getAddSTableColumnSql(tbName, addFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("add table column error:" + JsonUtil.toJsonString(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//找出删除的字段
|
||||
List<TdField> dropFields = oldFields.stream().filter((f) -> newFields.stream()
|
||||
.noneMatch(old -> old.getName().equals(f.getName())))
|
||||
.collect(Collectors.toList());
|
||||
if (dropFields.size() > 0) {
|
||||
sql = TableManager.getDropSTableColumnSql(tbName, dropFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("drop table column error:" + JsonUtil.toJsonString(response));
|
||||
//找出修改的字段
|
||||
List<TdField> modifyFields = newFields.stream().filter((f) -> oldFields.stream()
|
||||
.anyMatch(old ->
|
||||
old.getName().equals(f.getName()) //字段名相同
|
||||
//字段类型或长度不同
|
||||
&& (!old.getType().equals(f.getType()) || old.getLength() != f.getLength())
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (modifyFields.size() > 0) {
|
||||
sql = TableManager.getModifySTableColumnSql(tbName, modifyFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("modify table column error:" + JsonUtil.toJsonString(response));
|
||||
}
|
||||
}
|
||||
|
||||
//找出删除的字段
|
||||
List<TdField> dropFields = oldFields.stream().filter((f) ->
|
||||
!"time".equals(f.getName()) &&
|
||||
!"device_id".equals(f.getName()) && newFields.stream()
|
||||
//字段名不是time且没有相同字段名的
|
||||
.noneMatch(n -> n.getName().equals(f.getName())))
|
||||
.collect(Collectors.toList());
|
||||
if (dropFields.size() > 0) {
|
||||
sql = TableManager.getDropSTableColumnSql(tbName, dropFields);
|
||||
response = tdRestApi.execSql(sql);
|
||||
if (response.getCode() != TdResponse.CODE_SUCCESS) {
|
||||
throw new RuntimeException("drop table column error:" + JsonUtil.toJsonString(response));
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
log.error("update thingmodel stable failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,32 +36,29 @@ public class ThingModelMessageDataImpl implements IThingModelMessageData {
|
|||
String identifier,
|
||||
int page, int size) {
|
||||
String sql = "select time,mid,product_key,device_name,type,identifier,code,data,report_time " +
|
||||
"from thing_model_message_%s %s order by time desc limit %d offset %d";
|
||||
"from thing_model_message where device_id=? %s order by time desc limit %d offset %d";
|
||||
|
||||
//构建动态条件
|
||||
List<Object> args = new ArrayList<>();
|
||||
List<String> cons = new ArrayList<>();
|
||||
args.add(deviceId);
|
||||
StringBuilder sbCond = new StringBuilder();
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
cons.add("type=?");
|
||||
sbCond.append(" and type=? ");
|
||||
args.add(type);
|
||||
}
|
||||
if (StringUtils.isNotBlank(identifier)) {
|
||||
cons.add("identifier=?");
|
||||
sbCond.append("and identifier=? ");
|
||||
args.add(identifier);
|
||||
}
|
||||
String condition = "";
|
||||
if (cons.size() > 0) {
|
||||
condition = "where " + String.join(" and ", cons);
|
||||
}
|
||||
|
||||
sql = String.format(sql, deviceId.toLowerCase(), condition, size, (page - 1) * size);
|
||||
sql = String.format(sql, sbCond.toString(), size, (page - 1) * size);
|
||||
List<TbThingModelMessage> ruleLogs = tdTemplate.query(sql,
|
||||
new BeanPropertyRowMapper<>(TbThingModelMessage.class),
|
||||
args.toArray()
|
||||
);
|
||||
|
||||
sql = String.format("select count(*) from thing_model_message_%s %s",
|
||||
deviceId.toLowerCase(), condition);
|
||||
sql = String.format("select count(*) from thing_model_message where device_id=? %s",
|
||||
sbCond.toString());
|
||||
List<Long> counts = tdTemplate.queryForList(sql, Long.class, args.toArray());
|
||||
long count = counts.size() > 0 ? counts.get(0) : 0;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-data</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ public interface IDbStructureData {
|
|||
void defineThingModel(ThingModel thingModel);
|
||||
|
||||
/**
|
||||
* 取消物模型定义
|
||||
* 更新物模型定义
|
||||
*/
|
||||
void undefineThingModel(ThingModel thingModel);
|
||||
void updateThingModel(ThingModel thingModel);
|
||||
|
||||
/**
|
||||
* 初始化数据库结构
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -17,6 +17,7 @@
|
|||
<module>iot-temporal-service</module>
|
||||
<module>iot-es-temporal-service</module>
|
||||
<module>iot-rdb-data-service</module>
|
||||
<module>iot-td-temporal-service</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>iot-data</artifactId>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>iot-message-rocketmq</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-client</artifactId>
|
||||
<version>4.9.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-model</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,11 @@
|
|||
### 支持rocketMq作为消息总线
|
||||
|
||||
版本:0.4.2
|
||||
|
||||
rocketMq版本:4.9.4
|
||||
|
||||
####开启方式:
|
||||
|
||||
1、application.yml中打开注释支持rocketMq作为消息总线
|
||||
|
||||
2、pom.xml中打开注释使用rocketmq消息总线
|
|
@ -0,0 +1,47 @@
|
|||
package cc.iotkit.rocketmq;
|
||||
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
import cc.iotkit.mq.ConsumerHandler;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
|
||||
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
|
||||
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
|
||||
import org.apache.rocketmq.common.message.MessageExt;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
public class RocketMqConsumer<T> implements MqConsumer<T> {
|
||||
|
||||
private String nameServer;
|
||||
|
||||
private final Class<T> msgType;
|
||||
|
||||
public RocketMqConsumer(String nameServer, Class<T> cls) {
|
||||
this.nameServer = nameServer;
|
||||
this.msgType = cls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void consume(String topic, ConsumerHandler<T> handler) {
|
||||
try {
|
||||
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(handler.getClass()
|
||||
.getName().replace(".", ""));
|
||||
consumer.setNamesrvAddr(nameServer);
|
||||
consumer.subscribe(topic, "*");
|
||||
consumer.registerMessageListener((MessageListenerConcurrently) (messages, context) -> {
|
||||
for (MessageExt message : messages) {
|
||||
T msg = JsonUtil.parse(new String(message.getBody(), StandardCharsets.UTF_8), msgType);
|
||||
handler.handler(msg);
|
||||
}
|
||||
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
|
||||
});
|
||||
consumer.start();
|
||||
} catch (Throwable e) {
|
||||
log.error("consume error", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cc.iotkit.rocketmq;
|
||||
|
||||
import cc.iotkit.common.exception.BizException;
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import org.apache.rocketmq.client.producer.DefaultMQProducer;
|
||||
import org.apache.rocketmq.common.message.Message;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class RocketMqProducer<T> implements MqProducer<T> {
|
||||
|
||||
private final DefaultMQProducer producer;
|
||||
|
||||
public RocketMqProducer(String nameServer, String group) {
|
||||
try {
|
||||
producer = new DefaultMQProducer(group);
|
||||
producer.setNamesrvAddr(nameServer);
|
||||
producer.start();
|
||||
} catch (Throwable e) {
|
||||
throw new BizException("init producer error", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publish(String topic, T msg) {
|
||||
try {
|
||||
producer.send(new Message(topic,
|
||||
JsonUtil.toJsonString(msg).getBytes(StandardCharsets.UTF_8)));
|
||||
} catch (Throwable e) {
|
||||
throw new BizException("publish msg error", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cc.iotkit.rocketmq.config;
|
||||
|
||||
import cc.iotkit.model.device.message.ThingModelMessage;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import cc.iotkit.rocketmq.RocketMqConsumer;
|
||||
import cc.iotkit.rocketmq.RocketMqProducer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class RocketMqConfig {
|
||||
|
||||
@Value("${rocketmq.name-server}")
|
||||
private String nameServer;
|
||||
|
||||
@Value("${rocketmq.producer.group}")
|
||||
private String group;
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqProducer<ThingModelMessage> getThingModelMessageProducer() {
|
||||
return new RocketMqProducer<>(nameServer, group);
|
||||
}
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqConsumer<ThingModelMessage> getThingModelMessageConsumer() {
|
||||
return new RocketMqConsumer<>(nameServer, ThingModelMessage.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>iot-vertx-event-bus</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-model</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,4 +1,13 @@
|
|||
package cc.iotkit.mq.vertx;
|
||||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.vertx;
|
||||
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
import io.vertx.core.buffer.Buffer;
|
|
@ -7,7 +7,7 @@
|
|||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.mq.vertx;
|
||||
package cc.iotkit.vertx;
|
||||
|
||||
import io.vertx.core.Vertx;
|
||||
|
|
@ -7,9 +7,8 @@
|
|||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.mq.vertx;
|
||||
package cc.iotkit.vertx;
|
||||
|
||||
import cc.iotkit.common.utils.JsonUtil;
|
||||
import cc.iotkit.mq.ConsumerHandler;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import io.vertx.core.AbstractVerticle;
|
|
@ -1,4 +1,4 @@
|
|||
package cc.iotkit.mq.vertx;
|
||||
package cc.iotkit.vertx;
|
||||
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import io.vertx.core.AbstractVerticle;
|
|
@ -0,0 +1,27 @@
|
|||
package cc.iotkit.vertx.config;
|
||||
|
||||
import cc.iotkit.model.device.message.ThingModelMessage;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import cc.iotkit.vertx.VertxMqConsumer;
|
||||
import cc.iotkit.vertx.VertxMqProducer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class VertxConfig {
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqProducer<ThingModelMessage> getThingModelMessageProducer() {
|
||||
return new VertxMqProducer<>(ThingModelMessage.class);
|
||||
}
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqConsumer<ThingModelMessage> getThingModelMessageConsumer() {
|
||||
return new VertxMqConsumer<>(ThingModelMessage.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package test;
|
||||
|
||||
import cc.iotkit.mq.ConsumerHandler;
|
||||
import cc.iotkit.mq.vertx.VertxMqConsumer;
|
||||
import cc.iotkit.mq.vertx.VertxMqProducer;
|
||||
import cc.iotkit.vertx.VertxMqConsumer;
|
||||
import cc.iotkit.vertx.VertxMqProducer;
|
||||
import io.vertx.core.AsyncResult;
|
||||
import io.vertx.core.Handler;
|
||||
import io.vertx.core.Vertx;
|
|
@ -5,12 +5,19 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
|
||||
<modules>
|
||||
<module>iot-message-core</module>
|
||||
<module>iot-vertx-event-bus</module>
|
||||
<module>iot-message-rocketmq</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -11,14 +11,9 @@ package cc.iotkit.ruleengine.config;
|
|||
|
||||
import cc.iotkit.model.device.message.ThingModelMessage;
|
||||
import cc.iotkit.mq.MqConsumer;
|
||||
import cc.iotkit.mq.MqProducer;
|
||||
import cc.iotkit.mq.vertx.VertxMqConsumer;
|
||||
import cc.iotkit.mq.vertx.VertxMqProducer;
|
||||
import cc.iotkit.ruleengine.handler.RuleDeviceConsumer;
|
||||
import cc.iotkit.ruleengine.rule.RuleMessageHandler;
|
||||
import cc.iotkit.ruleengine.task.TaskManager;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -32,12 +27,6 @@ public class RuleConfiguration {
|
|||
return new RuleDeviceConsumer(consumer, Collections.singletonList(ruleMessageHandler));
|
||||
}
|
||||
|
||||
@ConditionalOnMissingBean
|
||||
@Bean
|
||||
public MqConsumer<ThingModelMessage> getThingModelMessageConsumer() {
|
||||
return new VertxMqConsumer<>(ThingModelMessage.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TaskManager getTaskManager() {
|
||||
return new TaskManager();
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 奇特物联 2021-2022 All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed 未经许可不能去掉「奇特物联」相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: xw2sy@163.com
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
package cc.iotkit.ruleengine.expression;
|
||||
|
||||
|
||||
|
|
Binary file not shown.
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -123,9 +123,21 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--内置vertx消息总线-->
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-vertx-event-bus</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--打开注释使用rocketmq消息总线-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cc.iotkit</groupId>-->
|
||||
<!-- <artifactId>iot-message-rocketmq</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-temporal-service</artifactId>
|
||||
|
@ -137,17 +149,17 @@
|
|||
</dependency>
|
||||
|
||||
<!--打开注释 启用es数据库-->
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-es-temporal-service</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--打开注释 启用tdengine数据库-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cc.iotkit</groupId>-->
|
||||
<!-- <artifactId>iot-td-temporal-service</artifactId>-->
|
||||
<!-- <artifactId>iot-es-temporal-service</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!--打开注释 启用tdengine数据库-->
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-td-temporal-service</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-data-cache</artifactId>
|
||||
|
|
|
@ -104,7 +104,7 @@ public class ProductController {
|
|||
dbStructureData.defineThingModel(thingModel);
|
||||
} else {
|
||||
//更新时序数据库物模型数据结构
|
||||
dbStructureData.undefineThingModel(thingModel);
|
||||
dbStructureData.updateThingModel(thingModel);
|
||||
}
|
||||
thingModelData.save(thingModel);
|
||||
}
|
||||
|
|
|
@ -55,22 +55,22 @@ spring:
|
|||
# ============mysql配置结束============>>
|
||||
|
||||
#<<================es时序数据配置开始===============
|
||||
# elasticsearch:
|
||||
# rest:
|
||||
# #使用内置es的配置
|
||||
# #uris: http://elasticsearch:9200
|
||||
# uris: http://127.0.0.1:9200
|
||||
# username:
|
||||
# password:
|
||||
# connection-timeout: 10s
|
||||
elasticsearch:
|
||||
rest:
|
||||
#使用内置es的配置
|
||||
#uris: http://elasticsearch:9200
|
||||
uris: http://127.0.0.1:9200
|
||||
username:
|
||||
password:
|
||||
connection-timeout: 10s
|
||||
#================es时序数据配置结束===============>>
|
||||
|
||||
#<<===========tdengine时序数据库配置开始============
|
||||
td-datasource:
|
||||
url: jdbc:TAOS-RS://127.0.0.1:6041/iotkit?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8
|
||||
username: root
|
||||
password: taosdata
|
||||
driverClassName: com.taosdata.jdbc.rs.RestfulDriver
|
||||
# td-datasource:
|
||||
# url: jdbc:TAOS-RS://127.0.0.1:6041/iotkit?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8
|
||||
# username: root
|
||||
# password: taosdata
|
||||
# driverClassName: com.taosdata.jdbc.rs.RestfulDriver
|
||||
#===========tdengine时序数据库配置开始============>>
|
||||
|
||||
|
||||
|
@ -86,6 +86,12 @@ spring:
|
|||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
|
||||
#application.yml中打开注释支持rocketMq作为消息总线,pom.xml中打开注释使用rocketmq消息总线
|
||||
#rocketmq:
|
||||
# name-server: 127.0.0.1:9876
|
||||
# producer:
|
||||
# group: iotkit
|
||||
|
||||
#图片存储用的是阿里云oss,如果需要上传产品图片才需要配置
|
||||
aliyun:
|
||||
bucketId:
|
||||
|
|
|
@ -67,6 +67,12 @@ aliyun:
|
|||
accessKeyId:
|
||||
accessKeySecret:
|
||||
|
||||
#application.yml中打开注释支持rocketMq作为消息总线,pom.xml中打开注释使用rocketmq消息总线
|
||||
#rocketmq:
|
||||
# name-server: 127.0.0.1:9876
|
||||
# producer:
|
||||
# group: iotkit
|
||||
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
token-name: token
|
||||
|
|
|
@ -86,6 +86,12 @@ spring:
|
|||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
|
||||
#application.yml中打开注释支持rocketMq作为消息总线,pom.xml中打开注释使用rocketmq消息总线
|
||||
#rocketmq:
|
||||
# name-server: 172.16.1.113:9876
|
||||
# producer:
|
||||
# group: iotkit
|
||||
|
||||
#图片存储用的是阿里云oss,如果需要上传产品图片才需要配置
|
||||
aliyun:
|
||||
bucketId:
|
||||
|
|
Binary file not shown.
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iot-test-tool</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>cc.iotkit.simulator.Application</mainClass>
|
||||
<mainClass>cc.iotkit.test.mqtt.performance.ReportTest</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
|
|
|
@ -35,6 +35,7 @@ public class ReportTest {
|
|||
if (args.length == 0) {
|
||||
Mqtt.brokerHost = "127.0.0.1";
|
||||
// Mqtt.brokerHost = "120.76.96.206";
|
||||
// Mqtt.brokerHost = "172.16.1.109";
|
||||
} else {
|
||||
Mqtt.brokerHost = args[0];
|
||||
}
|
||||
|
@ -60,10 +61,6 @@ public class ReportTest {
|
|||
"TEST_SC_" + StringUtils.leftPad(finalI + "", 6, "0"),
|
||||
"S01");
|
||||
|
||||
gateway.addSubDevice("xpsYHExTKPFaQMS7",
|
||||
"TEST_LT_" + StringUtils.leftPad(finalI + "", 6, "0"),
|
||||
"L01");
|
||||
|
||||
gateway.onDeviceOnline((device) -> {
|
||||
String pk = device.getProductKey();
|
||||
if (!"Rf4QSjbm65X45753".equals(pk)) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
17
pom.xml
17
pom.xml
|
@ -14,7 +14,6 @@
|
|||
<module>iot-message-bus</module>
|
||||
<module>iot-test-tool</module>
|
||||
<module>iot-data</module>
|
||||
<module>iot-data/iot-td-temporal-service</module>
|
||||
</modules>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -25,7 +24,7 @@
|
|||
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iotkit-parent</artifactId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
<name>iotkit-parent</name>
|
||||
<description>iotkit parent</description>
|
||||
<properties>
|
||||
|
@ -271,7 +270,19 @@
|
|||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-bus</artifactId>
|
||||
<artifactId>iot-message-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-vertx-event-bus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.iotkit</groupId>
|
||||
<artifactId>iot-message-rocketmq</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
|
Loading…
Reference in New Issue