Does CQRS need to be fire and forget, If we need to read guarantee after command?

I'm in researching phase of CQRS+ES. Never done in real world yet. But very soon. However what I saw in StackOverflow and projects, CQRS seems to be fire and forget. So what if there is a chain command which need result from another command. First example, reward management and account management bounded contexts Application layer send GiveReward command to reward management Reward management fire a CreateTransaction command to account bounded context, And get the result as TransactionID(GUID). Refer to this answer, I can get the TransactionID while CQRS was fire and forget Reward management need to use some data of that transaction by query it from account management using TransactionID before fire next event. Here how can I guarantee account management has finish creating read model, So that reward management can read it? Second example, Rest API to open a Gacha box. User call this api. Application layer send OpenGacha command. Business layer fire and forget GachaOpenedEvent. How can rest api guarantee OpenGachaEvent has created the read model? These scenario lead me to a question, Does CQRS need to be fire and forget, If we need to read guarantee after command? Any others solution to solve this problem?

Apr 24, 2025 - 14:35
 0
Does CQRS need to be fire and forget, If we need to read guarantee after command?

I'm in researching phase of CQRS+ES. Never done in real world yet. But very soon.

However what I saw in StackOverflow and projects, CQRS seems to be fire and forget.

So what if there is a chain command which need result from another command.

First example, reward management and account management bounded contexts

  1. Application layer send GiveReward command to reward management

  2. Reward management fire a CreateTransaction command to account bounded context, And get the result as TransactionID(GUID). Refer to this answer, I can get the TransactionID while CQRS was fire and forget

  3. Reward management need to use some data of that transaction by query it from account management using TransactionID before fire next event.

Here how can I guarantee account management has finish creating read model, So that reward management can read it?

Second example, Rest API to open a Gacha box.

  1. User call this api.

  2. Application layer send OpenGacha command.

  3. Business layer fire and forget GachaOpenedEvent.

How can rest api guarantee OpenGachaEvent has created the read model?

These scenario lead me to a question,

Does CQRS need to be fire and forget, If we need to read guarantee after command?

Any others solution to solve this problem?