如何检查 RabbitMQ 队列中某个时间间隔范围内可用的空闲插槽?
我正在研究 GMail API。我可以使用 Gmail API 一次性发送大量电子邮件。但是现在,我需要安排不同时间间隔的邮件,而不是一次发送所有邮件。
Gmail API 不提供这种控制邮件送达率的服务。为此,我使用rabbitMQ 的服务并创建一个队列,然后将邮件放入其中。在排队时,我必须提供延迟,使其适合空闲槽的可用性,并且邮件在空闲槽和时间间隔之间平均分配。
目前,我对如何在队列中找到可用的空闲插槽感到震惊。
我已经浏览了 RabbitMQ - 监控文档,我能找到的唯一相关内容是:-队列详细信息的响应
,但我仍然不知道如何扣除特定时间间隔的免费可用插槽。帮我找到它。
提前致谢!
I am working on GMail API. I can send bulk email at once using the Gmail APIs. However now, I need to schedule the mails in different time intervals instead of sending the all the mail at once.
This service of control deliverability of mail is not provided by the Gmail API. So for that I am using the services of rabbitMQ and creating a queue and then enqueuing the mails into it. While enqueuing , I must provide the delay such that it fits the free slot availability and also the mails are distributed equally among free slots and time intervals.
Currently I am struck at how to find available free slots in the queue.
I have gone through the RabbitMQ - Monitoring Documentations and only relevant thing which I could found is :-Response of queue details
but still I am clueless how to deduct the free available slots for a particular time interval. Help me to find it.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,GMail API 中没有“安排”发送电子邮件的功能。不过,有一个长期存在的功能请求。
关于 RabbitMQ,我不认为消息队列应该以这种方式工作,我建议您实现自己的任务池方法。
例如,拥有一个集中的任务列表(如关系数据库表),其中包含以下最少信息:
发送电子邮件
)每日 | 14:00-16:00
或2022-02-03 | 14:00-16:00
例如){recipient: “[电子邮件受保护]”,正文:“Hello World!”}< /code> 例如)
负责将任务添加到此队列/池表的调度程序服务可以具有类似
findATime()
或listAvailableSpotsForTheDay()
。Currently there is no feature in GMail API to “schedule” an email to be sent. However there is a long standing Feature Request for that.
Regarding RabbitMQ, I don’t think a message queue is meant to work that way, I’d recommend implementing your own take to that approach of a pool of tasks.
For example, having a centralized list of tasks (like a relational DB table) that would have minimal information about:
send email
for example)Daily | 14:00-16:00
or2022-02-03 | 14:00-16:00
for example){recipient: “[email protected]”, body:”Hello World!”}
for example)A scheduler service that is responsible for adding tasks to this queue/pool table can have a method like
findATime()
orlistAvailableSpotsForTheDay()
.