Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kombu & celery with SQS #222 #1779

Merged
merged 6 commits into from Aug 31, 2023

Conversation

shoaib-mohd
Copy link
Contributor

@shoaib-mohd shoaib-mohd commented Aug 31, 2023

SQS broker url doesn't include queue_name_prefix #222
ANSWER:-
I have used the below code for queue_name_prefix...
It is in Flask and Django App running on production..

from celery import Celery
def make_celery(app):
    celery = Celery(
        app.import_name,
        broker="sqs://",
        broker_transport_options={
            "queue_name_prefix": "{SERVICE_ENV}-{SERVICE_NAME}-"
        },
    )
    task_base = celery.Task

    class ContextTask(task_base):
        abstract = True

        def __call__(self, *args, **kwargs):
            with app.app_context():
                return task_base.__call__(self, *args, **kwargs)

    celery.Task = ContextTask

    return celery

@auvipy auvipy added this to the 5.3.x milestone Aug 31, 2023
docs/userguide/connections.rst Outdated Show resolved Hide resolved
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or should we use the docs in celery instead?

docs/userguide/connections.rst Outdated Show resolved Hide resolved
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
@shoaib-mohd
Copy link
Contributor Author

shoaib-mohd commented Aug 31, 2023

It would help if you used the docs in Kombu and Celery.

@auvipy auvipy changed the title + celery with sqs #222 Kombu & celery with SQS #222 Aug 31, 2023
docs/userguide/connections.rst Outdated Show resolved Hide resolved
docs/userguide/connections.rst Outdated Show resolved Hide resolved
docs/userguide/connections.rst Outdated Show resolved Hide resolved
@auvipy auvipy merged commit a4efb9c into celery:main Aug 31, 2023
14 checks passed
@shoaib-mohd shoaib-mohd mentioned this pull request Aug 31, 2023
@shoaib-mohd
Copy link
Contributor Author

Hello @auvipy
Should I also contribute the same in Celery?

@auvipy
Copy link
Member

auvipy commented Aug 31, 2023

I think we can hold of for now, but in future we might try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants