简体   繁体   English

我需要做些什么来转换当前使用cron来使用RabbitMQ的系统?

[英]what i need to do to convert my current system which use cron to use RabbitMQ?

my current script using CRON to handle the checking to DB and do the requests 我当前的脚本使用CRON来处理对数据库的检查并执行请求

so every mint the CRON will be called and check which action should be done as per the schedule table entry so if now the time to send email/publish post etc... 因此,每个薄荷糖都会调用CRON,并根据时间表表条目检查应执行的操作,以便确定现在是否有时间发送电子邮件/发布帖子等...

and this entry getting more and more with time and with many users now my CRON take around 20 to 50 mint to be done so if I have to send email on 10 AM it sends between 10:20 AM to 10:50 AM 随着时间的流逝,这个条目越来越多,并且对于许多用户而言,我的CRON需要花费大约20至50薄荷糖,因此,如果我必须在10 AM发送电子邮件,它将在10:20 AM至10:50 AM之间发送

after searching I found RabbitMQ and Redis and other systems and I choose RabbitMQ 搜索后,我发现RabbitMQ和Redis等系统,然后选择RabbitMQ

so what is next, what I need to do next, as for my experience I never work with a system like Redis etc.. so its something totally new, so if someone has and resources to check read or watch and help me with migrating the whole system from CRON to RabbitMQ. 所以接下来是什么,接下来我需要做的是,就我的经验而言,我从未使用过Redis等系统。因此,它是全新的,因此,如果有人有足够的资源来检查阅读或观看内容并帮助我迁移从CRON到RabbitMQ的整个系统。

small note, the current script is built on top of custom PHP framework only for this script and don't have API. 请注意,当前脚本仅在此脚本的自定义PHP框架之上构建,并且没有API。

  1. Write a php shell script for create linux pid in a infinite loop and call a method by cron. 编写一个用于在无限循环中创建linux pid的php shell脚本,然后由cron调用方法
  2. Every job push to rabbitMq basic_publish with data set. 每个作业都通过数据集推送到rabbitMq basic_publish。
  3. this method create a basic_consume with rabbitMq for performing queue with queue data set. 方法使用rabbitMq创建一个basic_consume来执行带有队列数据集的队列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM