当前位置:网站首页>添加通知公告,给在线用户发送通知
添加通知公告,给在线用户发送通知
2022-06-29 10:05:00 【海涛高软】
//添加一条通知公告,给在线用户发送通知
ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,0, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<>());
executor.execute(new Runnable() {
@Override
public void run() {
for (UserDO userDO : sessionService.listOnlineUser()) {
for (Long userId : userIds) {
if (userId.equals(userDO.getUserId())) {
template.convertAndSendToUser(userDO.toString(), "/queue/notifications", "新消息:" + notify.getTitle());
}
}
}
}
});
executor.shutdown();FR:徐海涛(hunk xu)
QQ技术交流群:386476712
边栏推荐
- 基于STM32+RFID设计的宿舍检修管理系统
- Reids设计与实现
- Essential for efficient work: how can testers improve their communication skills?
- Several methods of enterprise competition analysis: SWOT, Porter five forces, pest "suggestions collection"
- Bug description, rating and life cycle
- 容器平台性能如何测试,稳定性、扩展效率、组件性能
- (JS)数组中纯函数
- NUC980开源项目16-从SPI FLASH(W25Q128)启动
- 如何优雅的写 Controller 层代码?
- 学习通否认 QQ 号被盗与其有关:已报案;iPhone 14 量产工作就绪:四款齐发;简洁优雅的软件早已是明日黄花|极客头条...
猜你喜欢

30-year-old female, ordinary software testing Yuanyuan, confused and anxious about her career

Essential for efficient work: how can testers improve their communication skills?

Ikvm Net project progress

Mongodb tutorial Chapter 02 mongodb installation

真正的测试 =“半个产品+半个开发”?

The encryption market has exploded one after another. Can Celsius avoid bankruptcy?

math_数学表达式&等式方程的变形&组合操作技巧/手段积累

Here comes the tutorial of datawhale recommendation system!

With this tool, automatic identification and verification code is no longer a problem

活动邀请 | Apache Doris 社区征文&演讲征集活动开始了!
随机推荐
C language printf family
Report card of regional industrial Internet market, the second place of Baidu intelligent yunkaiwu
Xiaomi mobile phone - Unlock BL + open root permission
Fully understand the MESI cache consistency protocol
【C语言进阶】动态内存管理
【C语言进阶】特殊自定义类型
内存分配——静态存储区 栈 堆 与static变量
Numeric Keypad
30岁,女,普通软件测试媛,对职业的迷茫和焦虑
细粒度识别、分类、检索数据集整理
【C语言进阶】自定义类型
加密市场接连爆雷,Celsius能避免破产吗?
Real test = "half product + Half development"?
Pytorch learning notes (6) -- source code analysis of dataloader
Print prime numbers between 100 and 200 (C language)
任职 22 年,PowerShell 之父将从微软离职:曾因开发 PowerShell 被微软降级过
PyTorch学习笔记(6)——DataLoader源代码剖析
He was in '98. I can't play with him
30-year-old female, ordinary software testing Yuanyuan, confused and anxious about her career
嵌入式学习书籍推荐[通俗易懂]