Let's mimic what we've done in the C# implementation and get the CausedBy, Causation and CorrelationId properly set up.
https://github.com/Cratis/Chronicle/tree/main/Source/Clients/DotNET
The Causation is a dynamic thing that can be expanded on, we should always have a root causation and everything after that should then be able to push/pop levels in the causation.
For Identity, we need a core way of getting current identity. In .net there is an identity object available on the current thread, not sure if there is such a thing in NodeJS. If there is, use that if that is something people are familiar with otherwise, introduce a mechanism for setting current identity. It should be scoped for current call context.
Similar for CorrelationId. In C# we have an interface representing the mutation of it and one representing the reading of it, then we have an implementation that implements both. Then we have interface segregation. Not sure if that makes sense in this context, but it needs to be per call context
Let's mimic what we've done in the C# implementation and get the CausedBy, Causation and CorrelationId properly set up.
https://github.com/Cratis/Chronicle/tree/main/Source/Clients/DotNET
The Causation is a dynamic thing that can be expanded on, we should always have a root causation and everything after that should then be able to push/pop levels in the causation.
For Identity, we need a core way of getting current identity. In .net there is an identity object available on the current thread, not sure if there is such a thing in NodeJS. If there is, use that if that is something people are familiar with otherwise, introduce a mechanism for setting current identity. It should be scoped for current call context.
Similar for CorrelationId. In C# we have an interface representing the mutation of it and one representing the reading of it, then we have an implementation that implements both. Then we have interface segregation. Not sure if that makes sense in this context, but it needs to be per call context