iot-mqtt-bridge
feature:
[x]解析简单mqtt消息存到mysql[]解析简单mqtt消息存到kafka[]解析复杂消息[]批处理存储数据[]自定义各种hadler你只需要在model.jso里定义一个描述文件,具体以含义看注释,
然后配置mqtt,mysql连接信息在bridge.yml,
运行release/bi/server 启动项目
就可以自动根据描述文件解析mqtt消息并存进数据库内。
[ { "ame":"user",//"动态生成的类名” "topic":"user_topic", "clietId":"user_cliet", "cleaSessio":true, "qos":1, "storeType":"mysql", "fields":[{ "ame":"id", "type":"log",//"存数据库字段的类型" "idex":1, "leght":8,//"截取多少个字节" "offset":2, "idType":"auto"//”如果是auto就是用数据库的自增,否则是截取到的数据“ }, { "ame":"logiLegth", "type":"it", "idex":2, "leght":2, "isTrasiet":true//"不持久化到数据库内" }, { "ame":"logi", "type":"byte[]", "idex":3, "depedsO":2//"根据指定idex的字段的值作为长度“ }]sprig: datasource: driver-class-ame:com.mysql.jdbc.Driver url:jdbc:mysql://localhost:3306/mqtt_test userame: password:jdbc: template: prefix:t_ suffix:_test isertGetId:false loggig: cofig:logback.xmlbridge: modelPath:model.jso mqtts: -url:tcp://localhost:1883 userame: password: keepAlive:20 retaied:false recoectAttemptsMax:-1 recoectDelay:10 models: -user









评论