-
Notifications
You must be signed in to change notification settings - Fork 44
EventStore
Charles Solar edited this page Jun 13, 2018
·
2 revisions
We use EventStore for reading and writing domain events. Behind the scenes Aggregates.NET sets up projections in eventstore for consumers to receive events they are interested in utilizing competing consumers.
Here's an example projection Aggregates.NET will create:
function processEvent(s,e) {
linkTo('mongodb.1.0', e);
}
fromStreams(['$ce-DOMAIN','$ce-OOB']).
when({
'eShop.Basket.Basket.Entities.Item.Events.ItemAdded, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Basket.Basket.Entities.Item.Events.ItemRemoved, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Basket.Basket.Entities.Item.Events.QuantityUpdated, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Basket.Basket.Events.BasketClaimed, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Basket.Basket.Events.Destroyed, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Basket.Basket.Events.Initiated, eShop.Basket.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.CatalogBrand.Events.Defined, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.CatalogBrand.Events.Destroyed, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.CatalogType.Events.Defined, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.CatalogType.Events.Destroyed, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.Product.Events.Added, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.Product.Events.DescriptionUpdated, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.Product.Events.PictureSet, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.Product.Events.PriceUpdated, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Catalog.Product.Events.Removed, eShop.Catalog.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Configuration.Setup.Entities.Basket.Events.Seeded, eShop.Configuration.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Configuration.Setup.Entities.Catalog.Events.Seeded, eShop.Configuration.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Configuration.Setup.Entities.Identity.Events.Seeded, eShop.Configuration.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Configuration.Setup.Entities.Ordering.Events.Seeded, eShop.Configuration.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Configuration.Setup.Events.Seeded, eShop.Configuration.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.Role.Events.Activated, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.Role.Events.Deactivated, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.Role.Events.Defined, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.Role.Events.Destroyed, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.Role.Events.Revoked, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Entities.Role.Events.Assigned, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Entities.Role.Events.Revoked, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Events.Disabled, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Events.Enabled, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Events.NameChanged, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Identity.User.Events.Registered, eShop.Identity.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Location.Location.Entities.Point.Events.Added, eShop.Location.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Location.Location.Entities.Point.Events.Removed, eShop.Location.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Location.Location.Events.Added, eShop.Location.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Location.Location.Events.DescriptionUpdated, eShop.Location.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Location.Location.Events.Removed, eShop.Location.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Marketing.Campaign.Events.Defined, eShop.Marketing.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Marketing.Campaign.Events.DescriptionChanged, eShop.Marketing.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Marketing.Campaign.Events.PeriodSet, eShop.Marketing.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Marketing.Campaign.Events.PictureSet, eShop.Marketing.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Entities.Address.Events.Added, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Entities.Address.Events.Removed, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Entities.PaymentMethod.Events.Added, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Entities.PaymentMethod.Events.Removed, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Events.InGoodStanding, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Events.Initiated, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Events.PreferredAddressSet, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Events.PreferredPaymentSet, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Buyer.Events.Suspended, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Entities.Item.Events.Added, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Entities.Item.Events.PriceOverridden, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Entities.Item.Events.Removed, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.AddressChanged, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.Canceled, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.Confirm, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.Drafted, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.Paid, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.PaymentMethodChanged, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent,
'eShop.Ordering.Order.Events.Shipped, eShop.Ordering.Language, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null': processEvent
});
This will create a projected stream containing all the events the Mongo endpoint is interested in