He-Pin opened a new pull request, #3275: URL: https://github.com/apache/pekko/pull/3275
### Motivation Projections and events-by-slice queries need to keep per-persistence-id sequence numbers gap free, which means filtered events must still be stored in the journal. Pekko Persistence had no shared placeholder payload for this, so query/projection plugins (e.g. r2dbc, projections) had nothing to align on. ### Modification - Add the public `FilteredPayload` case object, serialized to a 0-byte representation by the new internal `FilteredPayloadSerializer` (manifest `"F"`, serializer id `34`). - Register the serializer, binding and identifier in persistence `reference.conf`. - Make typed `EventEnvelope.event`/`getEvent` raise a clearer error when the payload is absent because the event was *filtered* (vs. simply *not loaded*). **Serializer id:** `34` matches the upstream id and follows pekko's established convention of preserving upstream serializer ids (e.g. `ReplicatedEventSourcingSerializer = 40` matches akka). Verified free within pekko's documented `0-40` reserved range. **Intentional divergence from upstream:** the upstream `akka-persistence-typed` reference.conf change was a cosmetic HOCON reformat (dotted key → block form) and is skipped; `scripts/show-serializer.sh` does not exist in pekko and is skipped. **Improvement over upstream:** added an `EventEnvelopeSpec` directional test covering the `filtered` vs `not loaded` error behaviour, which upstream shipped without a test. ### Result Pekko Persistence has a standard placeholder for filtered journal events, flagged as `filtered` in the typed `EventEnvelope`, enabling query and projection plugins to represent gap-free sequence numbers. which is now Apache licensed ### Tests - `sbt "persistence/testOnly org.apache.pekko.persistence.serialization.FilteredPayloadSerializerSpec"` (1/1 passed) - `sbt "persistence-query/testOnly org.apache.pekko.persistence.query.typed.EventEnvelopeSpec"` (2/2 passed) - `sbt "persistence/mimaReportBinaryIssues" "persistence-query/mimaReportBinaryIssues"` (clean) ### References Ports [akka/akka-core@b179bb1](https://github.com/akka/akka-core/commit/b179bb15279962d657b9192f374a98123fabd7ee) (akka#31985), which is now Apache licensed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
