Activity Queue
Activities and notifications would both benefit from a queue service, allowing:
- resending of undelivered requests for x attempts
- ignoring duplicate notifications
I propose that we develop a system to provide this within DjangoLDP
There are many libraries which provide this functionality, standing out for me are Celery, DjangoQ and Huey. I've used Celery before and found it comprehensive, if a bit of a pain to deploy with Elastic Beanstalk (AWS)
The objectives of the Queue are to:
-
attempt to resend the activity 3 times (by default) if it fails. If it's completely unable, save the
Activity
withsuccess = False
- if there are multiple activities scheduled on the same (resource, inbox) combination, send only the most recent.. for example when Create/Update is fired multiple times
- if the server is restarted, recover the scheduled activities on the queue
- thread-safe queue usage
Possibly also:
-
validate
Update
activity objects have new info before sending the notification (#234 (closed) ) - better admin display for activities
-
after an expiry date, old
Activity
objects are deleted, with a cron job? Seems to be omitted from the ActivityStreams spec - view to get the status of the ActivityQueue (admin)
- if unable to send an activity inform a sentry server: #281 (closed)
- UWSGI config on startup: server-manager#82 (closed)