stegeman / symfony-messenger-cloud-events
Symfony Messenger Cloud Events
Installs: 169
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:bundle
pkg:composer/stegeman/symfony-messenger-cloud-events
Requires
- cloudevents/sdk-php: ^1.1
- jms/serializer-bundle: ^5.5
- ramsey/uuid: ^4.9
- symfony/config: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/http-kernel: ^7.3
- symfony/messenger: ^7.3
Requires (Dev)
- matthiasnoback/symfony-config-test: ^6.1
- phpunit/phpunit: ^11.2
This package is auto-updated.
Last update: 2025-10-07 11:45:06 UTC
README
Install
composer require stegeman/symfony-messenger-cloud-events
Enable the bundle in your kernel:
bundles.php
return [
...
Stegeman\Messenger\CloudEvents\CloudEventsBundle::class => ['all' => true],
...
];
Configuration
Configure the correct serializer for your transport:
transports:
async:
...
serializer: 'Stegeman\Messenger\CloudEvents\Serializer\CloudEventsSerializer'
...
To prevent your messages will be mapped to a PHP namespace each message must be named and matched with a message. This can be done by adding name -> class mapping to your configuration (config/packages/cloud_events.yaml) :
cloud_events:
registry:
- name: "test-event"
className: "App\\Domain\\Event\\TestEvent"
Now it is known which name to map to which class. This is necessary for both serializing as deserializing.
This is all that is needed to get started.
All set, go!
Override services
It is possible to override the normalizer service. This can be done by adding the following to your configuration (config/packages/cloud_events.yaml):
cloud_events:
...
normalizer_service_id: name.of.your.own.normalizer.service