I will describe my problem with a very typical example, an e-commerce application.
Says we have to manage
Products, and we have 2 bounded contexts
Warehouse that store the product information.
Sales bounded context cares about price, product name, description.
Warehouse bounded context cares about sizes, position, quantity, quality.
When we create a new product, we have to input all of the above information. Following the CQRS pattern, we have to send 2 commands
Create Product to
Warehouse bounded context, which could be 2 microservices.
The problem is, if the
Product is created in
Sales, but not valid to be created in
Warehouse, or the command to
Warehouse is not sent, then the
Sales does not make sense. The same goes with the reverse.
So how do you create an object, in this case, a product, that appears in multiple bounded contexts?