Using a projection like
fromStreams(["$et-Foo", "$et-Bar", "$et-Baz"]).
when({
Foo: function(s,e) { linkTo("MyNewStream", e); },
Bar: function(s,e) { linkTo("MyNewStream", e); },
Baz: function(s,e) { linkTo("MyNewStream", e); }
});
When using a catchupsubscription against a single node, some events are presented out of order (eg Child added to parent before parent has been created). I verified this by storing timestamps within the events.
Is there a way to ensure the correct ordering?
see open issue:
https://github.com/EventStore/EventStore/issues/814
not using $et seems to have helped, but I agree you would like to be able to compose things.
Thanks for the link. It listed the issue, but did not seem to give a solid conclusion.
From what I have read , here are two possibilities mentioned in the documentation
- This option
options({
reorderEvents: true,
processingLag: 500 //time in ms
});
2) Using $all which optimises internally (Although it implies that the optimisation is similar to that of my original problem projection)
Foo: function(s,e) { linkTo("MyNewStream", e); },
Bar: function(s,e) { linkTo("MyNewStream", e); },
Baz: function(s,e) { linkTo("MyNewStream", e); }
fromAll().
when({});
**Do either/both of these guarantee original ordering, because if this is not guaranteed I have to do a lot of processing to handle out of order.**
**Or am I approaching this wrong.**
I tried out approach (2) and the events are in order.
2 does. 1 will almost always have them right (basically they need to
be outside a 500ms window in real time in order to be not out of
order) this shouldn't really happen on a single log but feasibly could
(long gc etc)