Events and Tenant Propagation
final readonly class CustomerService
{
#[CommandHandler]
public function handle(RegisterCustomer $command, EventBus $eventBus)
{
// register Customer
$eventBus->publish(new CustomerWasRegistered($command->customerId));
}
#[EventHandler]
public function sendNotificationWhen(CustomerWasRegistered $event, NotificationSender $notificationSender)
{
$customer = Customer::find($event->customerId);
$notificationSender->sendWelcomeNotification($customer);
}
}Context and Metadata Propagation

Database Message Channel

Last updated
Was this helpful?