Symfony Messenger Simultaneously Message with Async #57409
Unanswered
vitamin-code
asked this question in
Q&A
Replies: 1 comment
-
The only thing I've understood is that one message is blocked by another. I don't know why, I don't know what kind of doctrine query you execute. Please improve the description. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm are using Symfony Messenger to handle batch updates on the database. It works fine and the async works but problem comes when there's multiple messages that need to run simultaneously.
The scenario that we have is:
Message # 1 is a doctrine query that updates the status of the records. This is batch update for example: 5000 transaction that updates the status to
abandoned
.Message # 2 is, a doctrine that create bulk transactions.
Here is the sample messenger.yaml
When
UpdateOldToAbandoned
is running, for example, it's updating the 5000 records, theCreateBulkTransactions
is blocked and it's waiting for theUpdateOldToAbandoned
to finish before running. It is critical because the user wants to see their new transaction, for example if they order just 1 on the products.The
UpdateOldToAbandoned
triggers a doctrine logic that gets the transaction that are 30 days of inactivity. After that data is retrieve, there's a loop that updates the transaction into abandoned (I needed to put it on the loop because there's additional logic I needed to put like the symfony workflow that checks if the data is valid for changing the status)I'm using the Doctrine transport
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
I'm not that geek in Symfony Messenger so your thoughts will be helpful for me! Looking forward to your kind thoughts.
Beta Was this translation helpful? Give feedback.
All reactions