1

I am a noob in AWS RabbitMQ, Celery and I have some issues going on. Please have a look:

pip install celery==5.2.7

My settings.py:

CELERY_BROKER_URL = 'amqps://username:password@url.mq.ap-south-1.amazonaws.com:5671'
CELERY_RESULT_BACKEND = 'rpc://'

My celery.py:

from __future__ import absolute_import, unicode_literals
import os
from celery import Celery

# Set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')

app = Celery('proj')

# Configure Celery
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

I run this command to run the celery and connect it to the RabbitMQ instance:

celery -A proj worker --loglevel=info --without-heartbeat --without-gossip --without-mingle

enter image description here

When I test to run the tasks and see if background tasks are running smoothly or not then I get this error in return: enter image description here

Cloud-Watch RabbitMQ instance Logs:

[info] <0.16852.7> connection <0.16852.7>: user 'username' authenticated and granted access to vhost '/'

[notice] <0.11484.7> TLS server: In state hello at tls_record.erl:564 generated SERVER ALERT: Fatal - Unexpected Message

[notice] <0.11484.7>  - {unsupported_record_type,71}

[notice] <0.31841.5>  - no_suitable_ciphers

[warning] <0.16852.7> client unexpectedly closed TCP connection

This issue exists with Amazon RabbitMQ instance only when i try to run the RabbitMQ-server locally then all tasks runs smootly.

1 Answers1

0

I don't know much about the solution but I followed this answer on stackoverflow (https://stackoverflow.com/a/41161692/14004419)

I just edited my settings.py file

old settings.py file:

CELERY_BROKER_URL = 'amqps://username:password@url.mq.ap-south-1.amazonaws.com:5671'
CELERY_RESULT_BACKEND = 'rpc://'

New Settings.py file:

CELERY_BROKER_URL = 'amqps://username:password@url.mq.ap-south-1.amazonaws.com:5671'
CELERY_RESULT_BACKEND = 'rpc://

CELERY_BROKER_TRANSPORT_OPTIONS = {
"region": "ap-south-1",
'queue_name_prefix': 'django_app-proj',
'visibility_timeout': 360,
'polling_interval': 1
}