Configuration

Service Name Configuration

In order for Ecotone how to route messages you need to register Service Name (Application Name).

Register Service Map for Consumption

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 Service Map for Publishing

Register Distributed Bus with given Service Map:

and define implementation of the distributed Message Channel:

withCommandMapping() is used to route commands to specific services, while withEventMapping() is used to subscribe to events from other services with optional filtering via subscription keys.

For concrete use case, read Main Section or Custom Features section.

Last updated

Was this helpful?