pjfanning opened a new pull request, #3650:
URL: https://github.com/apache/pekko/pull/3650
### Motivation
Some journal implementations can write an event payload together with its
serialization
information without serializing it again. Callers that already hold the
serialized bytes of
an event need a way to pass them through to the journal without a
deserialize/serialize round
trip. Such a wrapper may also be sent across the cluster, so it needs a
serializer.
### Modification
- New public `org.apache.pekko.persistence.SerializedEvent(bytes,
serializerId, serializerManifest)`.
- The internal `FilteredPayloadSerializer` (id 34) now also serializes
`SerializedEvent`
with manifest `"S"`, using the existing `PersistentPayload` protobuf
message.
- `SerializedEvent` is bound to the `pekko-persistence-filtered` serializer
in `reference.conf`.
- Unknown manifests now fail with `NotSerializableException` instead of
decoding to `FilteredPayload`.
- `FilteredPayloadSerializerSpec` extended with `SerializedEvent` round trip
tests.
### Result
`SerializedEvent` can be handed to journals that support it and can be sent
over remoting.
### Tests
Not run locally - left to CI
### References
Ported from (Apache-2.0 since 2026-10-23):
- https://github.com/akka/akka-core/pull/32068
### Notes for reviewers
- `FilteredPayloadSerializer` keeps its class name, serializer id 34 and
`"F"` manifest, so
the `FilteredPayload` wire format is unchanged and no MiMa excludes are
needed.
- Rolling upgrade: nodes on older versions decode any manifest of serializer
34 as
`FilteredPayload`, so a `SerializedEvent` sent to an old node would be
silently read as
`FilteredPayload`. Avoid sending `SerializedEvent` across the cluster
until all nodes run
the new version.
- No journal in this repository writes `SerializedEvent` yet; support is up
to journal plugins.
- `SerializedEvent` has no structural `equals`/`hashCode` (it wraps an
`Array[Byte]`).
- No new config settings; only a new serialization binding.
--
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]