Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
my-flink-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI算法平台
my-flink-project
Commits
7708b1e5
You need to sign in or sign up before continuing.
Commit
7708b1e5
authored
May 12, 2023
by
周昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、添加mqtt报错信息
2、修改监听mqtt频道前缀
parent
aa4d8424
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
src/main/java/com/censoft/flink/StreamingJob.java
src/main/java/com/censoft/flink/StreamingJob.java
+1
-1
src/main/java/com/censoft/flink/mqtt/MqttConsumer.java
src/main/java/com/censoft/flink/mqtt/MqttConsumer.java
+1
-0
No files found.
src/main/java/com/censoft/flink/StreamingJob.java
View file @
7708b1e5
...
...
@@ -45,7 +45,7 @@ public class StreamingJob {
//2、接收消息并将数据转化为流
//todo 根据场景id 拼接对应的mqtt频道名称
DataStream
<
AlgorithmPushDto
>
mqttStream
=
env
.
addSource
(
new
MqttConsumer
(
"/censoft/test/"
+
sceneId
));
DataStream
<
AlgorithmPushDto
>
mqttStream
=
env
.
addSource
(
new
MqttConsumer
(
"/censoft/test
1
/"
+
sceneId
));
//3、进行处理
//3、0 更新场景在线时间
...
...
src/main/java/com/censoft/flink/mqtt/MqttConsumer.java
View file @
7708b1e5
...
...
@@ -58,6 +58,7 @@ public class MqttConsumer extends RichParallelSourceFunction<AlgorithmPushDto> {
System
.
out
.
println
(
"MQTT连接成功:"
+
mqttConfigBean
.
getClientId
()
+
":"
+
client
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"MQTT连接异常:"
+
e
);
e
.
printStackTrace
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment