Repository navigation
Release v19.153.0
Reducers now receive events in pages that span many event sources, page sizes follow what a client declares, the .NET client checks batch methods at compile time and in tests, and event sequences gain a resumable bulk import for hundreds of thousands of events.
Added
- Client reducers that take pages receive events in pages spanning many event sources on live delivery, catch-up and replay. The kernel reads the current read models of a page together, writes the event sources that succeeded together, and writes nothing for an event source the reducer failed or deferred. See Batches for reducers.
[BatchSize]on a reactor or reducer declares the most events and bytes in one page and, for reducers, how many event sources of a page are reduced at once (MaxConcurrency, the processor count by default).MaxDelayMillisecondsis accepted but not applied yet.- The kernel honors the page bounds a client declares on every path, capped by the new
Observers.MaxEventsPerPage(1 000 by default) andObservers.MaxBytesPerSubscriberCall(4 MiB by default) settings. A delivery above the bounds is sent as several pages in order, and a single event larger than the byte bound is sent on its own. See Observers configuration. - Analyzers CHR0070 to CHR0077 report batch method mistakes at compile time:
[Observes<T>]on a method that does not take anEventBatch, a batch method that observes nothing, an event type that reaches more than one method, aBatchContexton a per-event method, a reactor batch method that returns something, a reducer that mixes batch and per-event methods, a batch signature Chronicle cannot call, and a warning for a pattern on an event type the method does not observe. See Code analysis. - Registering a reactor or reducer refuses a batch method whose parameters Chronicle cannot supply, and a per-event reducer method that takes a
BatchContext. A batch method may declareCancellationToken cancellationToken = default. ReactorScenarioruns batch methods: the events of oneEvents(...)call, or ofGiven.Page(...)across event sources, reach them as one page, andShouldHaveFailedandShouldHaveDeferredassert what a batch method settled.ReadModelScenarioruns batch reducers and surfaces a deferral asReducerDeferred.- Event sequences can import large volumes of events through a resumable import session:
eventLog.Import(events)takes anIAsyncEnumerableorIEnumerableand streams it in chunks, andBeginImportgives an explicit session that can be reattached byImportId. Every event is validated before anything is committed, the commit runs as a job that survives restarts without appending twice, ordinary appends keep flowing during the commit, and observers catch up on the imported events chunk by chunk. See Importing events. EventForEventSourceIdgainsCorrelationId,CausedBy,GenerationandSourceSequenceNumber, which imports carry through to the stored events.- Kernel configuration section
Importssets staging retention (24 hours by default), the commit chunk size and the chunk limits clients receive.
Changed
- Reactors and reducers that take pages now get pages of at most
Observers.MaxEventsPerPageevents andObservers.MaxBytesPerSubscriberCallbytes, where a page previously had no byte limit. Raise the settings if a client needs larger pages. - A failed write of one event source in a reducer page now fails only that event source, and a concurrent single-event-source reduce is reported as handled only once its state is stored.
Fixed
- Client reactors and reducers with pages now receive live pages spanning several event sources. Because a client always subscribes with filters, and a burst larger than the live delivery budget was not split, live delivery previously sent one event source at a time.