Time to Live
Message Handler Time to Live
#[TimeToLive(new TimeSpan(seconds: 50))]
#[Asynchronous("notifications")]
#[EventHandler(endpointId: "welcomeEmail")]
public function sendWelcomeNotificationWhen(UserWasRegistered $event): void
{
// handle welcome notification
}Using Expression language
#[TimeToLive(expression: 'headers["expirationTime"]']
#[Asynchronous("notifications")]
#[EventHandler(endpointId: "welcomeEmail")]
public function sendWelcomeNotificationWhen(UserWasRegistered $event): void
{
// handle welcome notification
}Message Time to Live
Controlling Header Override Behavior
Using Attribute as Default (Not Override)
Last updated
Was this helpful?