0

There are two services running in my application (Srvice1, Servie2). A request is sent from the client to Service1 and Service1 calls a task as follows.

result = my_task.apply_async (kwargs = data)

And my_task calls an operation on server two:

@shared_task()
def my_task(** kwargs):
     return Server2.do_job(kwargs)
 
 

Similarly, Service2 performs a series of celery tasks and eventually has to return the output to Service1.

Question: How can I wait for the answer to be returned from server two?

I used result.get() to solve the problem but got no result.

Saeed
  • 3,294
  • 5
  • 35
  • 52
  • How do you run your Celery worker? Give us the command line please. Could it be that you are sending to the wrong queue? – DejanLekic Jun 10 '22 at 11:34
  • @DejanLekic `celery -A config.celery worker -l info -n worker_user`. celery.py is in the `config` folder. – Saeed Jun 10 '22 at 12:28

0 Answers0