Home > Article > Backend Development > Do I need to set a queue name in the queue?
The problem is this. When we push tasks to the queue, it is inevitable that the tasks pushed are diverse, such as emails, text messages, etc. When the background work process takes the tasks, our thoughts are often imprisoned, thinking that I pushed Tasks are pushed by category, so do they need to be obtained by category? Then multiple task processing processes may need to be started at this time. In fact, the only difference between them is the parameters of the task category. Isn’t this a bad design?
The problem is this. When we push tasks to the queue, it is inevitable that the tasks pushed are diverse, such as emails, text messages, etc. When the background work process takes the tasks, our thoughts are often imprisoned, thinking that I pushed Tasks are pushed by category, so do they need to be obtained by category? Then multiple task processing processes may need to be started at this time. In fact, the only difference between them is the parameters of the task category. Isn’t this a bad design?
Determine it based on the business scenario. If the business volume is relatively large, it is obviously not appropriate to use one process to handle the task
I still recommend using different queues to process different information. Although the parameters can be used to separate them, it is not conducive to the isolation and expansion of subsequent large concurrency. For example, a certain business only focuses on SMS information, so it monitors the SMS message queue. Yes