New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bycorrid #1622
Conversation
var metadata = JObject.Parse(data.Metadata); | ||
var indexedEventType = data.EventType; | ||
|
||
string correlationId = metadata["$correlationId"].Value<string>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the property key "$correlationId" configurable (similar to how category has a configurable option). Currently we use "correlationId" in our metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ha always been $correlationId (ued by projection etc a well internally). You could however write your own projection which is equivalent in js pretty easily.
fromAll().
when({
$any : function(s,e) {
if(e.metadata.correlationId) {
linkTo("MyCorrelationId-" + e.metadata.correlationId, e);
}
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we currently use our own by_correlation_id projection (which is almost identical to this one), it would just be nice to be able to switch over to the built in one instead. If it's too difficult to make this configurable similar to category, I understand.
fromAll().when({
$any:(function(s,e) {
if (e.metadata === null) return;
var correlationId = e.metadata.correlationId;
if (!correlationId) return;
var formattedCorrelationId = correlationId.replace(/-/g, "");
linkTo('$process.event.CorrelationId-' + formattedCorrelationId, e);
})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Salgat please note that this has now been added.
the projection source now accepts a json string to set a custom correlation id property, example: {"correlationIdProperty":"$myCorrelationId"}
@gregoryyoung can you please squash your commits? I've also pushed a few fixes. Will test again tomorrow and merge. |
450cb45
to
9fe09fd
Compare
Add $by_correlation_id to _standardProjections list Metadata parsing bugfixes Add/Fix tests
Rename $originalEventTimestamp to $eventTimestamp
@shaan1337 and @gregoryyoung Is this also going to be in the Web Admin UI? As I'm creating docs for that too right now. |
Ah sorry @shaan1337 @gregoryyoung this is for that new feature that will come. |
This PR adds a new internal projection $by_correlation_id. This makes a stream per correlation id which can be useful in many scenarios. In the future this is the internal work required for building up the correlationid graph which will also use causationid to show the full graph.