Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
cf56eaa7
Commit
cf56eaa7
authored
Jun 23, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis 过期事件通知
parent
9c52ffc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceMsgComsumerStartedService.java
...n/applicationservice/DeviceMsgComsumerStartedService.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+7
-0
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
cf56eaa7
...
...
@@ -274,7 +274,7 @@ public class DeviceApiController {
TopicPartitionInfo
info
=
TopicPartitionInfo
.
builder
().
exchangeName
(
exchangeName
).
topic
(
Constant
.
UPLOAD_TOPIC
+
deviceEntity
.
getDeviceMac
()).
build
();
TbQueueMsgHeaders
header
=
new
DefaultTbQueueMsgHeaders
();
header
.
put
(
MessageHeader
.
MESSAGETYPE
,
Constant
.
MESSAGETYPE_HEARTBEAT
);
for
(
int
i
=
0
;
i
<
10
00
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
deviceService
.
sendDeviceMessage
(
deviceEntity
,
info
,
header
,
JSON
.
toJSONString
(
req
),
null
);
// Thread.sleep(50);
}
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceMsgComsumerStartedService.java
View file @
cf56eaa7
...
...
@@ -74,7 +74,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
log
.
info
(
"服务端消费消息服务开始.."
);
TbQueueConsumer
<
TbQueueMsg
>
mainConsumer
=
consumerService
.
getMainConsumer
();
if
(!
ObjectUtils
.
isEmpty
(
mainConsumer
))
{
//订阅所有已
几快
活设备
//订阅所有已
激
活设备
Set
<
TopicPartitionInfo
>
topicPartitionInfoSet
=
deviceService
.
find
(
new
DeviceQuery
().
active
(
ActiveEnum
.
已激活
.
getValue
()).
status
(
StatusEnum
.
启用
.
getValue
())).
stream
()
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
platformService
.
get
(
f
.
getPlatformId
())))
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
productService
.
get
(
f
.
getProductId
())))
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
cf56eaa7
...
...
@@ -114,6 +114,13 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//注册rabbmit相关队列与绑定
registerRabbitQueue
(
deviceEntity
,
platformEntity
,
productEntity
);
TbQueueConsumer
<
TbQueueMsg
>
mainConsumer
=
consumerService
.
getMainConsumer
();
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
TopicPartitionInfo
topicPartitionInfo
=
new
TopicPartitionInfo
(
Constant
.
UPLOAD_TOPIC
+
deviceCode
,
null
,
exchangeName
);
Set
<
TopicPartitionInfo
>
topicPartitionInfos
=
new
HashSet
<>();
topicPartitionInfos
.
add
(
topicPartitionInfo
);
mainConsumer
.
subscribe
(
topicPartitionInfos
);
//新增设备通知第三方平台
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceStatusEnum
.
ACTIVE
);
}
...
...
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