Last active
January 16, 2022 19:27
-
-
Save dgafka/8f57fc43f8111bb0676064e572fee187 to your computer and use it in GitHub Desktop.
microservices-integration-in-php-11.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#[CommandHandler("order")] | |
public function handle(OrderCommand $command) | |
{ | |
$this->distributedBus->sendCommand( | |
"order_service", | |
"placeOrder", | |
\json_encode(["personId" => $personId, "products" => $products]), | |
"application/json" | |
); | |
throw new \RuntimeException("Something bad happened"); | |
$this->distributedBus->sendCommand( | |
"promotion_service", | |
"promoteUser", | |
\json_encode(["personId" => $personId]), | |
"application/json" | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment