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
413563ef
Commit
413563ef
authored
Jun 22, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis 过期事件通知
parent
8099ae28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
...ase/framework/listener/CustomerKeyExpirationListener.java
+3
-1
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartService.java
...rtals/xhx/daemon/applicationservice/DemoStartService.java
+1
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
View file @
413563ef
package
com.mortals.xhx.base.framework.listener
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.redis.connection.Message
;
import
org.springframework.data.redis.connection.MessageListener
;
import
org.springframework.stereotype.Component
;
...
...
@@ -9,11 +10,12 @@ import org.springframework.stereotype.Component;
* @date: 2022/6/22 16:40
* @description:
**/
@Slf4j
@Component
public
class
CustomerKeyExpirationListener
implements
MessageListener
{
@Override
public
void
onMessage
(
Message
message
,
byte
[]
bytes
)
{
String
key
=
message
.
toString
();
System
.
out
.
println
(
"监听到key:"
+
key
+
"过期"
);
log
.
info
(
"监听到key:"
+
key
+
"过期"
);
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartService.java
View file @
413563ef
...
...
@@ -27,7 +27,7 @@ public class DemoStartService implements IApplicationService {
log
.
info
(
"初始化发送线程数量"
);
sendTaskThreadPool
.
init
(
20
);
cacheService
.
setnx
(
"test-expire"
,
"111"
,
Duration
.
ofMinutes
(
1
).
toMillis
()
);
cacheService
.
setnx
(
"test-expire"
,
"111"
,
100
);
log
.
info
(
"开始服务..[配置已加载完成,但部分框架还未初始化,比如:Kafka]"
);
}
...
...
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