当前位置:网站首页>Manually push a message platform
Manually push a message platform
2022-06-23 22:10:00 【Is paidaxing there】
Design implementation
design scheme
Ready to push material
- Import the data of the message recipient
- Select conditions to pull the data of message recipients from each business line
The first point : Importing the data of the message receiver can support excel Import , Then go to each business line to get complete users id that will do , The imported data needs to be submitted to the service or dropped in the database in pages
Second point : Select conditions to pull message receiver data from each business line , First drop the task and its information into the database , It will be difficult to get millions of stores synchronously from the business line , It is designed to be delivered in the form of sequential messages mq Carry out self production and self marketing .
Design sequential consumption mq To pull store data by using customer service screening criteria
The system adopts rocketmq Natural support to ensure sequential delivery (messageQueueSelector), The principle can be referred to This article .
Limit the number of threads consumed to ensure the self-protection of services in the case of large data consumption
Using this method will lead to mq Performance degradation of , If there is a large amount of data and high concurrent consumption ,mq The throughput of the service will decrease , So in order to prevent mq The service has collapsed, and there are not many such data itself , This can be limited topic Number of consuming threads .
consumption mq The message starts to pull store data
adopt mq The task information delivered , Pull the conditions selected by the user to pull the data of the message receiver to be sent from each business line ( At this stage, you only need to pull stores ). After pulling the store data, all push materials are ready , At this time, users can click start sending or make an appointment to send .
Problems in fetching store data online
Because the conditions of message push center are the conditions of user filtering , And these conditions are some enumeration values , So there is no way to get to the index when getting store data , If you check through these conditions and the amount of data that meets these conditions is very small, it will lead to full table scanning and call interface timeout , Reach... Online 8 second .
Solution
Each business line can pull data from the database through the cursor every time, and then put it into the database redis To filter the data according to the conditions , Then return , In this way, the problem of interface timeout can be solved .
Push message
Two push strategies need to be supported ,mq Push and multithreaded push
Multithreaded push
Use multithreading to push , Pull the recipient's data from the database page , Execute the task of sending messages according to the task submitted to the thread pool , After sending the message, return the number of messages sent , Use future Get the asynchronous execution result of the thread by blocking .
mq Push
Push all message recipients to mq Self marketing , Consumption to mq Push the message to the recipient
边栏推荐
- CAD图在线Web测量工具代码实现(测量距离、面积、角度等)
- How to improve the high concurrency of the server
- 北大、加州伯克利大学等联合| Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data(基于未标记数据的结构化知识的领域自适应文本分类)
- What causes the applet SSL certificate to expire? How to solve the problem when the applet SSL certificate expires?
- What is the meaning of the two-way and one-way cn2 lines in Hong Kong, China?
- Selenium批量查询运动员技术等级
- Dart series: look at me for security. The security feature in dart is null safety
- How to write test cases efficiently?
- [同源策略 - 跨域问题]
- Using h5ai to build Download Station
猜你喜欢

Peking University, University of California Berkeley and others jointly | domain adaptive text classification with structured knowledge from unlabeled data (Domain Adaptive Text Classification Based o

实验五 模块、包和库

万字长文!一文搞懂InheritedWidget 局部刷新机制

Code implementation of CAD drawing online web measurement tool (measuring distance, area, angle, etc.)

HDLBits->Circuits->Arithmetic Circuitd->3-bit binary adder

Polar cycle graph and polar fan graph of high order histogram

北大、加州伯克利大学等联合| Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data(基于未标记数据的结构化知识的领域自适应文本分类)

University of North China, Berkeley University of California, etc. | Domain Adaptive Text Classification with structural Knowledge from unlabeled data

Data visualization: summer without watermelon is not summer

Selenium batch query athletes' technical grades
随机推荐
Framework not well mastered? Byte technology Daniel refined analysis notes take you to learn systematically
Detailed explanation of logical structure, physical structure and data operation
《scikit-learn机器学习实战》简介
[same origin policy - cross domain issues]
HDLBits->Circuits->Arithmetic Circuitd->3-bit binary adder
Notepad++ installing the jsonview plug-in
v-chart
Improve efficiency, take you to batch generate 100 ID photos with QR code
The most common usage scenarios for redis
Simple code and design concept of "back to top"
Freiburg University, Hildesheim University and other universities in Germany jointly | zero shot automl with pre trained models (zero sample automl based on pre training model)
Redis source code analysis -- QuickList of redis list implementation principle
How does the hybrid cloud realize the IP sec VPN cloud networking dedicated line to realize the interworking between the active and standby intranet?
Tencent cloud server ubuntu18 installs MySQL and logs in remotely
Selenium批量查询运动员技术等级
Leetcode must review six lintcode (28348455116385)
Bluetooth chip | Renesas and Ti launch new Bluetooth chip, try Lenz st17h65 Bluetooth ble5.2 chip
Modify jar package
How to wrap QR code data
《阿里云天池大赛赛题解析》——O2O优惠卷预测