I have problem with django, celery and rabbitmq.
I use celery to send messages to FCM devices, but problem is that celery doesn't run that FCM command for sending messages, until I restart celery server.
And when I restart celery, and try again, still same, I need to restart it again after every action.
Example code:
from __future__ import absolute_import, unicode_literals
from celery import shared_task
# firebase cloud messaging
from fcm.utils import get_device_model
Device = get_device_model()
@shared_task
def send_firebase_message(json, **kwargs):
response = Device.send_msg(json, **kwargs)
return response
This is simple code, so this Device.send_msg
doesn't fire until I restart celery server.
So, celery doesn't do this task until i restart it. Maybe it is rabbitmq problem?
Anyone got any solution for this? What can be the problem?