используется для выполнения команд (Command): создание объекта, отправка электронной почты и т.д.
В этом случае, компоненты ИС выступают в роли отправителей команд, а другие компоненты - в роли получателей и исполнителей этих команд
отслеживать состояние выполнения команды и сообщать об ошибке, если такая произошла (Job Manager)
The Command bus matches commands to handlers. This matching can be done automatically by some kind of naming convention. Another option is to register the relationships on the command bus.
Ensure the transport of a Command to its Handler. The Command Bus receives a Command, which is nothing more than a message describing intent, and passes this onto a Handler which is then responsible for performing the expected behavior.
The standard interface also makes it possible for additional functionality to be added by wrapping with decorators, or by adding middleware.
Events are not (supposed to be) handled in a separate database transaction, like commands are.
Event Bus используется для передачи событий (event) между компонентами системы. В этом случае, компоненты генерируют события, а другие компоненты слушают эти события и реагируют на них соответствующим образом.