Hi, I have a user defined projection that reads from a few categories, performs some logic & conditionally links events together via linkTo
, the pseudo code for the projection is as follows:
fromCategories(['A', 'B', 'C'])
.when({
$any: function(s, e)
{
var streamName = e.streamName;
var streamId = e.streamId;
switch(streamName){
case "stream-a":
if(someCondition){
linkTo(`New.Stream-${streamId}`, e);
}
break;
case "stream-b":
if(someOtherCondition){
linkTo(`New.Stream-${streamId}`, e);
}
break;
case "stream-c":
linkTo(`New.Stream-${streamId}`, e);
break;
}
}
});
I need to update the projection so that it reads from a further category, D
, the projection will be updated as follows
fromCategories(['A', 'B', 'C', 'D'])
.when({
$any: function(s, e)
{
var streamName = e.streamName;
var streamId = e.streamId;
switch(streamName){
case "stream-a":
if(someCondition){
linkTo(`New.Stream-${streamId}`, e);
}
break;
case "stream-b":
if(someOtherCondition){
linkTo(`New.Stream-${streamId}`, e);
}
break;
case "stream-c":
linkTo(`New.Stream-${streamId}`, e);
break;
case "stream-d":
linkTo(`New.Stream-${streamId}`, e);
break;
}
}
});
From this thread I understand that all of the events in category D
would have to be processed by the projection as it isn’t easily to set the start position of a stream within a projection.
Currently D
has in the region of 82 million events. ‘B’ averages 20 events/second, A
& C
are < 1 event/second.
What I’d like to understand is
- What happens when I add
D
to the projection- Will processing of new events on
A
,B
&C
be impacted whilst the projection catches up with events fromD
? - Is it advisable to consume events from
$ce-New.Stream
whilst the projection catches up? - Is it possible to estimate how long it will take for the projection to catch up with events from
D
?
- Will processing of new events on
I’m running event store 5.0.8.0 & currently have 4 persistent subscribers subscribed to $ce-New.Stream