Configuration

Service Name Configuration

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

Configure Distribution

To create AMQP Distributed configuration use Service Context.

Distributed Message Publisher

This will register DistributedBus in Dependency Container, which can be used to send Distributed Messages:

class MessagingConfiguration
{
    #[ServiceContext] 
    public function distributedPublisher()
    {
        return AmqpDistributedBusConfiguration::createPublisher();
    }
}

After that DistributedBus will become available in Dependency Container, ready to start sending Messages.

Distributed Message Consumer

This will enable Message Consumer with Service Name, which can consume Distributed Messages:

Run the consumer

Run consumer for your registered distributed consumer. It will be available under your Service Name

List:

Run it:

Last updated

Was this helpful?