Asynchronous Processing and Workers
Asynchronous processing, workers, delayed messages and dead letter in Tempest
Durable Message Channel
use Ecotone\Dbal\DbalBackedMessageChannelBuilder;
use Ecotone\Messaging\Attribute\ServiceContext;
final class MessagingConfiguration
{
#[ServiceContext]
public function notificationsChannel(): DbalBackedMessageChannelBuilder
{
return DbalBackedMessageChannelBuilder::create('notifications');
}
}use Ecotone\Messaging\Attribute\Asynchronous;
use Ecotone\Modelling\Attribute\EventHandler;
final readonly class NotificationRecorder
{
#[Asynchronous('notifications')]
#[EventHandler(endpointId: 'notifications.order_placed')]
public function whenOrderWasPlaced(OrderWasPlaced $event): void
{
// executed by the background worker
}
}Running the Worker
Delayed Messages
Enriching Messages on the Way
Retries and Dead Letter
Serialization of Collections
Last updated
Was this helpful?