messenger.bus.shopware
. It is mandatory to use this message bus if your messages should be handled inside Shopware. However if you want to send messages to external systems you can define your custom message bus for that.handle_message
middleware will actually call your handlers for the given message. You can add your own middleware by implementing the MiddlewareInterface
and adding that middleware to the message bus through configuration.handle_messages
middleware. Handlers do the actual processing of the message, therefore they must extend the AbstractMessageHandler
-class and implement the handle()
method. To register a handler you have to tag it with the messenger.message_handler
tag. To specify which methods should be handled by a given handler implement the static getHandledMessages()
method and return the MessageClasses which that handler should handle. You can also define multiple handlers for the same message.