@AggregateMember question

I was checking usage of @AggregateMember and have one question. If I have this setup

AggregateRoot --AggregateRootHAS–> List --Entitiy1HAS–> List

and if I have some event SomeEventInAR(arid=1, ent1id=2, ent2id=3) triggered, but I also have same listeners in Entity1 and Entity2, with @AggregateMember annotation in AR and List and List I will have this event routed down the stack.

Question is - will this event end up in each of the handlers in two lists or only in the single entity that needs it?

Entity that needs it in this case is:

AggregateRoot{
[
Entity1{
[
Entity2{},
Entity2{},
Entity2{},
1000 times…
Entity2{} <------------ this one has arid=1, ent1id=2, ent2id=3 AND SHOULD BE ONLY RECEIVING EVENT
]
},
Entity1{},
Entity1{},
1000 times…
Entity1{}
]
}

Hi Boyan,

at this moment, all entities receive all events that are published from an aggregate. Your entities will need to filter the events that they want to act upon.
We do have ideas to filter based on an attribute on the @AggregateMember annotation, but did 't find its way to the top of the backlog yet.

Cheers,

Allard