Hey
I have a problem with the same events being recieved several times, because the same event appears several times in the projected stream.
How do I prevent this?
The most problematic/reoccurring event is “RoomstayPlanned”, which does occur in a couple of other projected streams… Is the same event being picked up several times because of “fromAll()”?
Anyway - the projection looks like this:
fromAll().when({
ReservationPlaced: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
RoomstayPlanned: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
RoomstayWasAssignedRoom: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
RoomstayWasUnassignedRoom: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
RoomWasAdded: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
RoomTypeWasAdded: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
PersonCreated: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
CompanyCreated: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
TransientGuestWasAddedToReservation: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
KnownGuestWasRelatedToReservation: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
},
ReservationBecameGroupReservation: function(s, e) {
linkTo(“Read_RoomAssignments_Assignments”, e);
}
});
And i caught the phenomenon in Postman; here you can see the same event being referenced, but with different “updated” timestamps:
http://localhost:2113/streams/Read_RoomAssignments_Assignments/340/forward/10
<?xml version="1.0" encoding="utf-8"?> Event stream 'Read_RoomAssignments_Assignments'http://localhost:2113/streams/Read_RoomAssignments_Assignments
2015-10-06T09:02:22.1623852Z
EventStore
3@ReservationAR-dd4023a8b50e4a679ddcfb8676cc7942http://localhost:2113/streams/ReservationAR-dd4023a8b50e4a679ddcfb8676cc7942/3
2015-10-06T09:02:22.2393873Z
EventStore
http://localhost:2113/streams/ReservationAR-dd4023a8b50e4a679ddcfb8676cc7942/3
2015-10-06T09:02:22.2373874Z
EventStore
http://localhost:2113/streams/ReservationAR-a3e7aa1e0bd9431aa49e508aa6b1fa5b/4
2015-10-06T09:02:22.2313869Z
EventStore
http://localhost:2113/streams/ReservationAR-a3e7aa1e0bd9431aa49e508aa6b1fa5b/4
2015-10-06T09:02:22.2303871Z
EventStore
http://localhost:2113/streams/ReservationAR-a3e7aa1e0bd9431aa49e508aa6b1fa5b/4
2015-10-06T09:02:22.229387Z
EventStore
http://localhost:2113/streams/ReservationAR-3844357a0659474297a1e18dee0cb8a8/4
2015-10-06T09:02:22.2223871Z
EventStore
http://localhost:2113/streams/ReservationAR-3844357a0659474297a1e18dee0cb8a8/4
2015-10-06T09:02:22.2213873Z
EventStore
http://localhost:2113/streams/ReservationAR-3844357a0659474297a1e18dee0cb8a8/4
2015-10-06T09:02:22.2183869Z
EventStore
http://localhost:2113/streams/ReservationAR-44d8c45cd04e44cab9dfec88e05d11bb/4
2015-10-06T09:02:22.2033866Z
EventStore
http://localhost:2113/streams/ReservationAR-0de2c58ba7394c97a2d31d518c80b92c/2
2015-10-06T09:02:22.1703856Z
EventStore