rabbitevents / protobuf
Protobuf extension for RabbitEvents
Installs: 5
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/rabbitevents/protobuf
Requires
- php: ^8.2
- google/protobuf: ^4.0
- rabbitevents/foundation: ^9.0
Requires (Dev)
- mockery/mockery: ^1.6.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
README
This extension provides Protocol Buffers support for RabbitEvents.
Installation
composer require rabbitevents/protobuf
Usage
The extension automatically registers ProtobufSerializer.
When you publish an event with a Google Protobuf Message object as the payload, strict typing ensures it is handled by the ProtobufSerializer.
$message = new MyProtobufMessage(); $message->setSomeField('value'); RabbitEvents::publish('my.event', $message);
The system detects the Protobuf message and uses the correct Content-Type (application/x-protobuf).
Examples
Examples are available in the ./examples directory.