File tree Expand file tree Collapse file tree
src/BookStore.ApiService/Infrastructure/Extensions
tests/BookStore.AppHost.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,11 +50,16 @@ public static IServiceCollection AddMartenEventStore(
5050
5151 // 50% improvement in throughput, less "event skipping"
5252 options . Events . AppendMode = EventAppendMode . Quick ;
53+ options . Events . UseArchivedStreamPartitioning = true ;
5354
5455 // These cause some database changes, so can't be defaults,
5556 // but these might help "heal" systems that have problems later
5657 options . Events . EnableAdvancedAsyncTracking = true ;
5758
59+ // Enables you to mark events as just plain bad so they are skipped
60+ // in projections from here on out.
61+ options . Events . EnableEventSkippingInProjectionsOrSubscriptions = true ;
62+
5863 // This will optimize the usage of Inline projections, but will force
5964 // you to treat your aggregate projection "write models" as being
6065 // immutable in your command handler code
@@ -171,7 +176,6 @@ static void RegisterEventTypes(StoreOptions options)
171176 _ = options . Events . AddEventType < Events . PublisherAdded > ( ) ;
172177 _ = options . Events . AddEventType < Events . PublisherUpdated > ( ) ;
173178 _ = options . Events . AddEventType < Events . PublisherSoftDeleted > ( ) ;
174- _ = options . Events . AddEventType < Events . PublisherSoftDeleted > ( ) ;
175179 _ = options . Events . AddEventType < Events . PublisherRestored > ( ) ;
176180
177181 // User events
Original file line number Diff line number Diff line change 22using BookStore . ApiService . Models ;
33using BookStore . Client ;
44using BookStore . Shared . Models ;
5+ using JasperFx . Events ;
56using Marten ;
67using Refit ;
78using Weasel . Core ;
@@ -142,6 +143,11 @@ public async Task CreateTenant_WithEmailVerification_CreatesUnconfirmedUser()
142143 opts . Connection ( connectionString ! ) ;
143144 opts . UseSystemTextJsonForSerialization ( EnumStorage . AsString , Casing . CamelCase ) ;
144145 _ = opts . Policies . AllDocumentsAreMultiTenanted ( ) ;
146+
147+ opts . Events . AppendMode = EventAppendMode . Quick ;
148+ opts . Events . UseArchivedStreamPartitioning = true ;
149+ opts . Events . EnableEventSkippingInProjectionsOrSubscriptions = true ;
150+
145151 opts . Events . TenancyStyle = Marten . Storage . TenancyStyle . Conjoined ;
146152 } ) ;
147153
Original file line number Diff line number Diff line change 66using BookStore . Shared . Models ;
77using JasperFx ;
88using JasperFx . Core ;
9+ using JasperFx . Events ;
910using Marten ;
1011using Microsoft . Extensions . Logging ;
1112using Projects ;
@@ -94,8 +95,11 @@ static async Task AuthenticateAdminAsync()
9495
9596 opts . Connection ( connectionString ) ;
9697 _ = opts . Policies . AllDocumentsAreMultiTenanted ( ) ;
97- // Configure Multi-Tenancy (Conjoined)
98- _ = opts . Policies . AllDocumentsAreMultiTenanted ( ) ;
98+
99+ opts . Events . AppendMode = EventAppendMode . Quick ;
100+ opts . Events . UseArchivedStreamPartitioning = true ;
101+ opts . Events . EnableEventSkippingInProjectionsOrSubscriptions = true ;
102+
99103 opts . Events . MetadataConfig . CorrelationIdEnabled = true ;
100104 opts . Events . MetadataConfig . CausationIdEnabled = true ;
101105 opts . Events . MetadataConfig . HeadersEnabled = true ;
You can’t perform that action at this time.
0 commit comments