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
6869ab04
Commit
6869ab04
authored
Nov 03, 2022
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息组件优化
parent
0b2b7c02
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
8 deletions
+22
-8
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+2
-2
SignServiceImpl.java
...mos/boot/module/jcs/biz/service/impl/SignServiceImpl.java
+5
-0
application-dev.properties
...ils-message/src/main/resources/application-dev.properties
+6
-3
application.properties
...t-utils-message/src/main/resources/application.properties
+1
-1
topic.json
...mos-boot-utils-message/src/main/resources/json/topic.json
+8
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
6869ab04
...
@@ -279,9 +279,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -279,9 +279,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
jsonObject
.
put
(
"data"
,
message
);
jsonObject
.
put
(
"data"
,
message
);
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
"e
qm
.iot.created"
,
jsonObject
.
toString
().
getBytes
(),
1
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"e
mq
.iot.created"
,
jsonObject
.
toString
().
getBytes
(),
1
,
false
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
(
);
log
.
info
(
String
.
format
(
"发送eqm转kafka消息失败:%s"
,
e
.
getMessage
())
);
}
}
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/SignServiceImpl.java
View file @
6869ab04
...
@@ -136,6 +136,11 @@ public class SignServiceImpl extends BaseService<SignDto,Sign,SignMapper> implem
...
@@ -136,6 +136,11 @@ public class SignServiceImpl extends BaseService<SignDto,Sign,SignMapper> implem
SerializerFeature
.
WriteMapNullValue
);
SerializerFeature
.
WriteMapNullValue
);
try
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
personSign
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
personSign
,
json
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
// 发送emq消息转kafka
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"topic"
,
personSign
);
jsonObject
.
put
(
"data"
,
json
);
emqKeeper
.
getMqttClient
().
publish
(
"emq.sign.created"
,
jsonObject
.
toString
().
getBytes
(),
1
,
false
);
}
catch
(
MqttException
e
)
{
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
amos-boot-utils/amos-boot-utils-message/src/main/resources/application-dev.properties
View file @
6869ab04
...
@@ -22,5 +22,8 @@ spring.redis.port=6379
...
@@ -22,5 +22,8 @@ spring.redis.port=6379
spring.redis.password
=
1234560
spring.redis.password
=
1234560
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
#需要监听得kafka消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
topics
=
akka.iot.created,akka.patrol.created
kafka.topics
=
null.topic
init.topics
=
akka.iot.created,akka.patrol.created
kafka.init.topics
=
akka.iot.created,akka.patrol.created
\ No newline at end of file
#需要监听得eqm消息主题 根据是否是中心极和站端选择需要监听得主题进行配置
emq.topic
=
eqm.iot.created,eqm.patrol.created
\ No newline at end of file
amos-boot-utils/amos-boot-utils-message/src/main/resources/application.properties
View file @
6869ab04
...
@@ -6,7 +6,7 @@ spring.jackson.time-zone=GMT+8
...
@@ -6,7 +6,7 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps
=
true
spring.jackson.serialization.write-dates-as-timestamps
=
true
# kafka集群信息
# kafka集群信息
spring.kafka.bootstrap-servers
=
1
27.0.0.1:9092
spring.kafka.bootstrap-servers
=
1
72.16.3.100:9092
# 生产者配置
# 生产者配置
# 设置大于0的值,则客户端会将发送失败的记录重新发送 # 重试次数
# 设置大于0的值,则客户端会将发送失败的记录重新发送 # 重试次数
spring.kafka.producer.retries
=
3
spring.kafka.producer.retries
=
3
...
...
amos-boot-utils/amos-boot-utils-message/src/main/resources/json/topic.json
View file @
6869ab04
[
[
{
{
"code"
:
"iot"
,
"code"
:
"iot"
,
"emqTopic"
:
"e
qm
.iot.created"
,
"emqTopic"
:
"e
mq
.iot.created"
,
"akkaTopic"
:
"akka.iot.created"
"akkaTopic"
:
"akka.iot.created"
},
},
{
{
"code"
:
"patrol"
,
"code"
:
"patrol"
,
"emqTopic"
:
"e
qm
.patrol.created"
,
"emqTopic"
:
"e
mq
.patrol.created"
,
"akkaTopic"
:
"akka.patrol.created"
"akkaTopic"
:
"akka.patrol.created"
},
{
"code"
:
"sign"
,
"emqTopic"
:
"emq.sign.created"
,
"akkaTopic"
:
"akka.sign.created"
}
}
]
]
\ No newline at end of file
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