wakeonweb / message-bus-receiver
WakeOnWeb MessageBus receiver
Installs: 3 460
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- prooph/service-bus: ^6.0
Suggests
- bernard/bernard: Receive message throught a queue system.
This package is auto-updated.
Last update: 2024-11-08 21:21:32 UTC
README
Installation
composer.json
"wakeonweb/message-bus-receiver": "^0.1"
If you use Symfony, you can load the bundle WakeOnWeb\MessageBusReceiver\App\Bundle\WakeonwebMessageBusReceiverBundle
.
Usage
Amqp Input
wakeonweb_message_bus_receiver:
buses:
my_event_bus:
bus: my_event_bus
inputs:
amqp:
message_name: EventBusExternalMessage
move_to_error_queue_on_error: false
message_factory:
mapping:
user_created: App\Event\UserCreatedEvent
foo: @id_service
Then in your prooph event bus definition:
prooph_service_bus:
event_buses:
my_event_bus:
message_factory: wow.message_bus_receiver.my_event_bus.message_factory
Define the bus where messages will be trigerred once catched.
Controller Route Input
wakeonweb_message_bus_receiver:
buses:
my_event_bus:
bus: my_event_bus
inputs:
controller_route: ~
message_factory:
mapping:
user_created: App\Event\UserCreatedEvent
foo: @id_service
Then in your routing:
my_incoming_events:
path: /incoming/events
defaults: { _controller: 'wakeonweb.message_bus_receiver.my_event_bus.route_input:indexAction' }
methods: [POST]
/!\ Supports only json body at this moment /!\