CHR0070: [Observes<T>] is only for batch methods
Rule description
Section titled “Rule description”[Observes<TEvent>] declares the event types of a batch method, a method whose first parameter is an EventBatch. A per-event method already declares its event type with its first parameter, so [Observes<TEvent>] on it has no meaning. Chronicle refuses to register the observer, so the mistake is reported at compile time.
Severity
Section titled “Severity”Error
How to fix
Section titled “How to fix”- To handle the events one at a time, remove
[Observes<TEvent>]and take the event as the first parameter. - To handle them together, make
EventBatchthe method’s first parameter and pattern-match on the events inside it.