当前位置:网站首页>消息队列之监控退款任务批处理过程
消息队列之监控退款任务批处理过程
2022-07-01 11:55:00 【weixin_2047679575】
上篇教程给大家介绍了如何通过批处理一次性执行多个队列任务,对于这种批处理场景,如果我们不知道目前的处理进度心里总是会发慌:对于队列里面的退款任务处理什么时候可以执行完毕?处理过程中会不会出现错误?对于这些问题,今天,我们就来看看如何监控队列任务的批处理,已经在批处理成功、失败时通知关联人员。
批处理执行进度
首先,在执行的过程中,我们可以通过如下代码获取退款任务批处理的执行进度、剩余任务、失败任务和是否取消:
成功时通知组织者
如果你想要在批处理执行成功后通知相关人员,可以在执行批处理前通过 then
回调进行定义,这里我们会发送邮件通知给会议组织方:
失败时通知组织者
和 JavaScript 中的异步编程类似,如果批处理执行失败,我们可以紧接着 then
回调通过 catch
回调在失败时通知会议组织方:
完成时通知组织者
最后,我们还可以通过 finally
回调定义批处理执行完毕后的业务逻辑,不管是批处理成功还是失败,都会执行这个代码块:
总结:
上述就是 如何监控队列任务的批处理,已经在批处理成功、失败时通知关联人员过程中所需要用到的代码,并且在不同的情况下能够更好的联系相关人员进行查看。
边栏推荐
- redis中value/hush
- Golang des-cbc
- 耐克如何常年霸榜第一名?最新財報答案來了
- Unity XLua 协程封装
- Explore the contour detection function findcontours() of OpenCV in detail with practical examples, and thoroughly understand the real role and meaning of each parameter and mode
- [MCU] [nixie tube] nixie tube display
- Prepare for the Blue Bridge Cup Day10__ PWM control light brightness
- IPlImage的width和widthStep
- 用于分类任务的数据集划分脚本
- Vscode shortcut key (the most complete) [easy to understand]
猜你喜欢
Introduction to unittest framework and the first demo
2022/6/28学习总结
Comment Cao définit la décimale de dimension
研发效能度量框架解读
[MCU] [nixie tube] nixie tube display
On recursion and Fibonacci sequence
Seckill system 03 - redis cache and distributed lock
Istio, ebpf and rsocket Broker: in depth study of service grid
Emotion analysis based on IMDB comment data set
图的理论基础
随机推荐
Exposure: a white box photo post processing framework reading notes
Value/set in redis
Learning summary on June 29, 2022
流动性质押挖矿系统开发如何制作,dapp丨defi丨nft丨lp流动性质押挖矿系统开发案例分析及源码
Golang根据参数引入相应配置文件的实现方式
Question: what professional qualities should test engineers have?
S7-1500PLC仿真
C summary of knowledge points 1
【单片机】【数码管】数码管显示
JS date format conversion method
Personnaliser le plug - in GRPC
Extended tree (I) - concept and C implementation
谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征
微信小程序开发 – 用户授权登陆「建议收藏」
CPI tutorial - asynchronous interface creation and use
Implementation of address book management system with C language
8 best practices to protect your IAC security!
How to set decimal places in CAD
Emotion analysis based on IMDB comment data set
Test case writing specification in unittest framework and how to run test cases