Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active January 16, 2022 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgafka/8f57fc43f8111bb0676064e572fee187 to your computer and use it in GitHub Desktop.
Save dgafka/8f57fc43f8111bb0676064e572fee187 to your computer and use it in GitHub Desktop.
microservices-integration-in-php-11.php
<?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