That's a standard problem. Here are two simple suggestions that you can use
(there are probably more strategies):
a) Enrich the ProductAdded event with all the details of supplier that
you need
at the very moment ProductAdded is published.
This is commonly done with records where you have a somewhat tighter
requirement
on the consistency of multiple related aggregates. For example,
invoices must
retain the original customer addresses even if the customer moves at a
later time.
There are multiple strategies how to enrich the event. You can for
example
listen to the ProductAdded event in a special event handler, query the
supplier
data and put a ProductAddedWithSupplierData event on the bus which is then
used to build the read model.
b) Keep track of *all* the SupplierRenamed events that you have
seen and answer the question "what was the supplier name at time X"
instead of
"what is the supplier's current name"?
On 10/11/2016 13:10, dypsok wrote:
> I know that's an old thread but I am facing the same kind of problems...
> How have you finally deal with it ?