Loading src/main/java/com/censoft/flink/mqtt/MqttConsumer.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ public class MqttConsumer extends RichParallelSourceFunction<AlgorithmPushDto> { //包装连接的方法 //包装连接的方法 private void connect() throws MqttException { private void connect() throws MqttException { //配置连接参数 //配置连接参数 MqttConfig mqttConfigBean = new MqttConfig("", "", "tcp://192.168.3.82:1883", "DC" + (int) (Math.random() * 100000000), msgTopic); MqttConfig mqttConfigBean = new MqttConfig("", "", "tcp://172.16.21.3:1883", "DC" + (int) (Math.random() * 100000000), msgTopic); //连接mqtt服务器 //连接mqtt服务器 client = new MqttClient(mqttConfigBean.getHostUrl(), mqttConfigBean.getClientId(), new MemoryPersistence()); client = new MqttClient(mqttConfigBean.getHostUrl(), mqttConfigBean.getClientId(), new MemoryPersistence()); MqttConnectOptions options = new MqttConnectOptions(); MqttConnectOptions options = new MqttConnectOptions(); Loading src/main/resources/mybatis.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -9,9 +9,9 @@ <!-- 下面是配置一下数据源,其实后面我们就不这样配置了,都在.yml文件中配置--> <!-- 下面是配置一下数据源,其实后面我们就不这样配置了,都在.yml文件中配置--> <dataSource type="POOLED"> <dataSource type="POOLED"> <property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="url" value="jdbc:mysql://192.168.4.221:3307/ry-vue?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true"/> <property name="url" value="jdbc:mysql://172.16.33.152:3306/ry-vue?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true"/> <property name="username" value="root"/> <property name="username" value="root"/> <property name="password" value="123456"/> <property name="password" value="root"/> </dataSource> </dataSource> </environment> </environment> </environments> </environments> Loading Loading
src/main/java/com/censoft/flink/mqtt/MqttConsumer.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -32,7 +32,7 @@ public class MqttConsumer extends RichParallelSourceFunction<AlgorithmPushDto> { //包装连接的方法 //包装连接的方法 private void connect() throws MqttException { private void connect() throws MqttException { //配置连接参数 //配置连接参数 MqttConfig mqttConfigBean = new MqttConfig("", "", "tcp://192.168.3.82:1883", "DC" + (int) (Math.random() * 100000000), msgTopic); MqttConfig mqttConfigBean = new MqttConfig("", "", "tcp://172.16.21.3:1883", "DC" + (int) (Math.random() * 100000000), msgTopic); //连接mqtt服务器 //连接mqtt服务器 client = new MqttClient(mqttConfigBean.getHostUrl(), mqttConfigBean.getClientId(), new MemoryPersistence()); client = new MqttClient(mqttConfigBean.getHostUrl(), mqttConfigBean.getClientId(), new MemoryPersistence()); MqttConnectOptions options = new MqttConnectOptions(); MqttConnectOptions options = new MqttConnectOptions(); Loading
src/main/resources/mybatis.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -9,9 +9,9 @@ <!-- 下面是配置一下数据源,其实后面我们就不这样配置了,都在.yml文件中配置--> <!-- 下面是配置一下数据源,其实后面我们就不这样配置了,都在.yml文件中配置--> <dataSource type="POOLED"> <dataSource type="POOLED"> <property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="url" value="jdbc:mysql://192.168.4.221:3307/ry-vue?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true"/> <property name="url" value="jdbc:mysql://172.16.33.152:3306/ry-vue?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong&allowMultiQueries=true"/> <property name="username" value="root"/> <property name="username" value="root"/> <property name="password" value="123456"/> <property name="password" value="root"/> </dataSource> </dataSource> </environment> </environment> </environments> </environments> Loading