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
0e78acd4
Commit
0e78acd4
authored
Apr 17, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kafka消息解析后发送mq消息格式错误 bug修改
parent
d9444816
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
KafkaConsumerService.java
.../com/yeejoin/amos/message/kafka/KafkaConsumerService.java
+1
-1
commonMessage.json
...-utils-message/src/main/resources/json/commonMessage.json
+10
-10
No files found.
amos-boot-utils/amos-boot-utils-message/src/main/java/com/yeejoin/amos/message/kafka/KafkaConsumerService.java
View file @
0e78acd4
...
@@ -67,7 +67,7 @@ public class KafkaConsumerService {
...
@@ -67,7 +67,7 @@ public class KafkaConsumerService {
try
{
try
{
JSONObject
object
=
JSONObject
.
fromObject
(
record
.
value
());
JSONObject
object
=
JSONObject
.
fromObject
(
record
.
value
());
com
.
alibaba
.
fastjson
.
JSONObject
jsonObj
=
ClassToJsonUtil
.
class2json
(
object
,
commonMessage
,
record
.
topic
());
com
.
alibaba
.
fastjson
.
JSONObject
jsonObj
=
ClassToJsonUtil
.
class2json
(
object
,
commonMessage
,
record
.
topic
());
emqKeeper
.
getMqttClient
().
publish
(
String
.
valueOf
(
jsonObj
.
get
(
"mqTopic"
)),
JSON
.
toJSONString
(
jsonObj
).
getBytes
(
"UTF-8"
),
0
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
String
.
valueOf
(
jsonObj
.
get
(
"mqTopic"
)),
JSON
.
toJSONString
(
jsonObj
.
getJSONObject
(
"data"
)
).
getBytes
(
"UTF-8"
),
0
,
false
);
log
.
info
(
"接收到Roma消息对象: {}"
,
object
);
log
.
info
(
"接收到Roma消息对象: {}"
,
object
);
ack
.
acknowledge
();
ack
.
acknowledge
();
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
...
...
amos-boot-utils/amos-boot-utils-message/src/main/resources/json/commonMessage.json
View file @
0e78acd4
[
[
{
{
"kafkaTopic"
:
"
k1
"
,
"kafkaTopic"
:
"
T_DC_MQ_REALDATA__guanggu
"
,
"mqTopic"
:
"romaSite/data/transmit"
,
"mqTopic"
:
"romaSite/data/transmit"
,
"data"
:
{
"data"
:
{
"dataType"
:
"
condition.station_psr_id
"
,
"dataType"
:
"
body.datatype
"
,
"value"
:
"
condition.station_psr_id
"
,
"value"
:
"
body.value
"
,
"timeStamp"
:
"
condition.station_psr_id
"
,
"timeStamp"
:
"
body.time_stamp
"
,
"quality"
:
"
condition.station_psr_id
"
,
"quality"
:
"
body.quality
"
,
"scadaId"
:
"
condition.station_psr_id
"
,
"scadaId"
:
"
body.key
"
,
"key"
:
"
condition.station_psr_id
"
,
"key"
:
"
body.key
"
,
"disCreate"
:
"
condition
.station_psr_id"
,
"disCreate"
:
"
body
.station_psr_id"
,
"name"
:
"
condition.station_psr_id
"
"name"
:
"
body.name
"
}
}
},
},
{
{
"kafkaTopic"
:
"
k2
"
,
"kafkaTopic"
:
"
T_DC_MQ_ALARM__guanggu
"
,
"mqTopic"
:
"romaSite/data/eventAlarm"
,
"mqTopic"
:
"romaSite/data/eventAlarm"
,
"data"
:
{
"data"
:
{
"timeStamp"
:
"body.warns.time"
,
"timeStamp"
:
"body.warns.time"
,
...
...
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