Below quick starts will teach you how to use specific Ecotone's
module in 5 minutes.
So you may quick start integration with your existing project or build new one with ease.
If you want to know in depth with Ecotone
, consider going through Tutorial.
Do you want to see examples straight away?
Choose your preferred platform Symfony
Laravel
or Lite (Only Ecotone)
and install accordingly with help of Installation Section.
In tutorial we will be using Command/Query/Event buses. It's important to know, how to access them depending on chosen platform.
There is no need for any extra configurationCommand/Query/Event Buses are automatically registered in Symfony Dependency Containerand are available using auto-wire system​As an example, we may inject Command into Symfony Controller:​use Ecotone\Modelling\CommandBus;​class UserController{private CommandBus $commandBus;​public function __contruct(CommandBus $commandBus){$this->commandBus = $commandBus;}​public function register(Request $request): Response{$this->commandBus->send(new RegisterUser($request->get("name")));return new Response();}}
There is no need for any extra configurationCommand/Query/Event Buses are automatically registered in Laravel Depedency Containerand are available using auto-wire system​As an example, we may inject Command Bus into Laravel Controller:​use Ecotone\Modelling\CommandBus;​class UserController extends Controller{private CommandBus $commandBus;​public function __contruct(CommandBus $commandBus){$this->commandBus = $commandBus;}​public function register(Request $request){$this->commandBus->send(new RegisterUser($request->input("name")));​return response('');}}
1. You may access Command/Query/Event buses using getGatewayByName method.​/** @var \Ecotone\Modelling\CommandBus $commandBus */$commandBus = $messagingSystem->getGatewayByName(\Ecotone\Modelling\CommandBus::class);​2. If your container implements GatewayAwareContainer, then all buses will beavailable for you via injection.​class SomethingUsingCommandBus{private CommandBus $commandBus;​public function __contruct(CommandBus $commandBus){$this->commandBus = $commandBus;}}​
​