Application scenario:
the client uploads the file and the django server writes a piece of status=1 data in the database. Then give it to rabbit to read the file and parse it. After parsing, set status to 2. The transmission format of
rabbitmq is {"file": "test", "dataSourceId": "1"}
. Because the id, is passed, sometimes rabbitmq will mistakenly report that there is no such record.
this is the way to write data
sleep
I would like to ask how to make the rabbitmq program wait until django has finished writing the data before reading it? Or there are other ideas to avoid not being able to read the data