Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
项目统一框架
amos-boot-biz
Commits
cc41ebf1
Commit
cc41ebf1
authored
Jun 27, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
emq连接修改
parent
bad77190
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
ApplicationRunnerImpl.java
...ejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
+1
-1
StartLoader.java
.../yeejoin/amos/boot/module/jcs/biz/config/StartLoader.java
+7
-2
AmostEquipApplication.java
...quip/src/main/java/com/yeejoin/AmostEquipApplication.java
+6
-1
PatrolApplication.java
...rol/src/main/java/com/yeejoin/amos/PatrolApplication.java
+2
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ApplicationRunnerImpl.java
View file @
cc41ebf1
...
...
@@ -62,6 +62,6 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
iSourceStatistics
.
initAllCategoryStatisticsData
(
SourceTypeEnum
.
IOT
);
maintenanceResourceDataService
.
subscribeTopic
();
emqKeeper
.
getMqttClient
().
subscribe
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
emqKeeper
.
subscript
(
ConfigPageTopicEnum
.
INTEGRATE
.
getTopic
(),
2
,
integratePageDataListener
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/config/StartLoader.java
View file @
cc41ebf1
...
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertNewsDto;
import
com.yeejoin.amos.component.rule.config.ClazzUtils
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.boot.ApplicationRunner;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.List
;
...
...
@@ -43,7 +45,9 @@ public class StartLoader implements ApplicationRunner {
public
void
loadSysParams
(){
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
topic
,
(
s
,
mqttMessage
)
->
{
emqKeeper
.
subscript
(
topic
,
1
,
new
EmqxListener
()
{
@Override
public
void
processMessage
(
String
s
,
MqttMessage
mqttMessage
)
throws
Exception
{
byte
[]
payload
=
mqttMessage
.
getPayload
();
String
obj
=
new
String
(
payload
);
...
...
@@ -57,8 +61,9 @@ public class StartLoader implements ApplicationRunner {
json
.
get
(
"id"
).
toString
(),
json
);
emqKeeper
.
getMqttClient
().
publish
(
topicweb
,
JSON
.
toJSON
(
alertNewsDto
).
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
}
}
});
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"订阅物联警情异常"
,
e
);
}
}
...
...
amos-boot-system-equip/src/main/java/com/yeejoin/AmostEquipApplication.java
View file @
cc41ebf1
...
...
@@ -74,6 +74,11 @@ public class AmostEquipApplication {
*/
@Bean
void
initMqtt
()
throws
MqttException
{
emqKeeper
.
getMqttClient
().
subscribe
(
"+/+/property"
,
1
,
carIotListener
);
try
{
emqKeeper
.
subscript
(
"+/+/property"
,
1
,
carIotListener
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"EMQ初始化连接失败!"
);
}
}
}
amos-boot-system-patrol/src/main/java/com/yeejoin/amos/PatrolApplication.java
View file @
cc41ebf1
...
...
@@ -102,8 +102,8 @@ public class PatrolApplication {
@Bean
void
initMqtt
()
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
patrolTopic
,
1
,
patrolMqttListener
);
}
catch
(
Mqtt
Exception
e
)
{
emqKeeper
.
subscript
(
patrolTopic
,
1
,
patrolMqttListener
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"EMQ初始化连接失败!"
);
}
...
...
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