Hello Community!
Do the projections have enough power to solve this?
I have two event types:
A: {
Message,
CorrelationId
}
and
B: {
ParentCorrelationId,
CorrelationId
}
I would like for each event A emit new event C:
C : {
Message,
ContextPath
}
where ContextPath is CorrelationId1/CorrelationId2/CorrelationId3/… computed from B (join) events.
For example, for sequence:
A: {Message: "something", CorrelationId: 1}
A: {Message: "something2", CorrelationId: 1}
B: {ParentCorrelationId: 1, CorrelationId: 2}
A: {Message: "something3", CorrelationId: 2}
A: {Message: "something4", CorrelationId: 1}
B: {ParentCorrelationId: 2, CorrelationId: 3}
A: {Message: "something5", CorrelationId: 3}
B: {ParentCorrelationId: 1, CorrelationId: 4}
A: {Message: "something6", CorrelationId: 4}
We should produce:
C: {Message: "something", ContextPath: "1"}
C: {Message: "something2", ContextPath: "1"}
C: {Message: "something3", ContextPath: "1/2"}
C: {Message: "something4", ContextPath: "1"}
C: {Message: "something5", ContextPath: "1/2/3"}
C: {Message: "something6", ContextPath: "1/4"}
Is it possible with projections?