In order for Ecotone
how to route messages you need to register Service Name (Application Name).
- Symfony Service Name Configuration
- Laravel Service Name Configuration
- Ecotone Lite Service Name Configuration
The minimum needed for enabling Distributed Bus with Service Map and start consuming is to tell Ecotone, that we do use Service Map within the Service
#[ServiceContext]
public function serviceMap(): DistributedServiceMap
{
return DistributedServiceMap::initialize();
}
and then we would define Message Channel, which we would use for for incoming messages:
#[ServiceContext]
public function channels()
{
return SqsBackedMessageChannelBuilder::create("distributed_ticket_service")
}
Register Distributed Bus with given Service Map:
#[ServiceContext]
public function serviceMap(): DistributedServiceMap
{
return DistributedServiceMap::initialize()
->withServiceMapping(
serviceName: "ticketService",
channelName: "distributed_ticket_service"
)
}
and define implementation of the distributed Message Channel:
#[ServiceContext]
public function channels()
{
return SqsBackedMessageChannelBuilder::create("distributed_ticket_service")
}
For concrete use case, read Main Section or Custom Features section.