MessageSerializer
final class MessageSerializer (View source)
| internal | Applications should register MessageCodecInterface implementations instead of invoking this persistence boundary directly. |
Persists registered messages in bounded, versioned JSON envelopes authenticated before hydration.
This serializer is a database-transport boundary. It never accepts legacy PHP serialization and derives a queue-specific HMAC key from the application's stable secret.
Constants
| private ENVELOPE_VERSION |
|
| private KEY_INFO |
|
Methods
Creates a bounded serializer over an explicit codec allow-list and application secret.
Encodes a registered message as an authenticated envelope suitable for database persistence.
Verifies a persisted envelope before resolving its alias or invoking a hydration codec.
Details
__construct
__construct(MessageCodecRegistry $codecs, string $applicationSecret, int $maxPayloadBytes = 1048576, int $maxJsonDepth = 32)
Creates a bounded serializer over an explicit codec allow-list and application secret.
encode
string
encode(object $message)
Encodes a registered message as an authenticated envelope suitable for database persistence.
decode
object
decode(string $payload)
Verifies a persisted envelope before resolving its alias or invoking a hydration codec.