Celery AmazonSQS
Tag: Ruby
Tag: Rails
Category: jekyll
Category: update
Category: git
Category: database
Category: PostgreSQL
Category: websocket
Category: ruby
Category: projects
Category: Redis
Category: mysql
Category: Mac
Category: Node
Category: NPM
Category: PM2
Category: nodejs
Category: Meteor
Category: Nginx
Category: gitLab
Category: Rails
- Why Ruby on Rails is better than Python Django?
- How to use Hotwire turbo in Rails 6 with Webpacker?
- Rails 6 Credentials (master.key and credentials.yml.enc)
- Rails Console
- JIRA-Atlassian-Connect-App-Django
- Rails 4 5.0 Session Cookie AuthenticityToken
- Rails Active Storage
- Rails 5 Source code Research
- 微信支付
- Rails零星笔记
Category: Homebrew
Category: CentOS
Category: FreeSwitch
Category: Ruby
- Ruby on Rails 8
- RESTful API
- Ruby on Rails 7
- Study from Ruby official website
- Ruby-Metaprogramming
- Ruby连数据库的问题
- rbenv使用
Category: Vim
Category: javascript
Category: React-Native
Category: Wechat
Category: homeland
Category: JavaScript
Category: Docker
Category: RubyMine
Category: Authorization
Category: RESTful-API
Category: Proxy
Category: Deploy
Category: Devise
Category: Bootstrap
Category: Active_Storage
Category: github
Category: Android
Category: cloud
Category: ssh
Category: python
Category: reactjs
Category: markdown
Category: ShadowSocks
Category: Code
Category: rails
Category: code
Category: Django
Category: Python
Category: DRF
Category: Fish
Category: Yarn
Category: Material-UI
Category: CSS
Category: aws
Category: uwsgi
Category: nginx
Category: docker
Category: React
Category: Enzyme
Category: Jira
Category: Interview
Category: JetBrain
Category: PyCharm
Category: ESLint
Category: Rails6
Category: NVM
Category: ssl
Category: tencent
Category: CI
Category: jenkins
Category: GitHub
Category: Credentials
Category: master.key
Category: Webpacker
Category: Turbo
Category: Hotwire
Category: Bootstrap5
Category: Flutter
Category: Clash
Category: Tor
Category: proxy
Category: Build
Category: SwitchyOmega
Category: Chrome-extension
Category: SQLAlchemy
Category: Algorithm
Category: Rails7
Category: Data
Category: Structure
Category: CPP
Category: Languages
Category: Golang
Category: Typescript
Category: Rails 8
Celery
These two issue are questions of mine:
1 If an exception is raised in your task, it seems that the task won’t be executed again.
Because the message has been deleted.
My answer: https://docs.celeryproject.org/en/stable/faq.html#faq-acks-late-vs-retry
The default of acks-late
is that the message is deleted once acknowledged by a worker.
https://docs.celeryproject.org/en/stable/userguide/tasks.html#Task.acks_late
But you can change this value to True
(In django might by doing CELERY_TASK_ACKS_LATE = True
).
Then your task may be consumed many times (The time interval of consuming will be the value of SQS Default visibility timeout
).
Amazon SQS
3 The Default visibility timeout
will not be working when acks-late
is False
(default).
I do the experiment by adding time.sleep(120)
and set Default visibility timeout
to 30 seconds.
@shared_task
def update_hubspot_deal(project_id):
time.sleep(120)
# Omit
Then the message will in Messages in flight (not available to other consumers)
.
Unless you purge the queue, the message will be consumed endlessly (many many times).
Because every 30 seconds, a worker will consume this message.
Troubleshoot
When the qa
server is prepared and running, when you connect to Amazon SQS qa
queue,
remember you message can be consumed by both your qa
server and your local machine.