Repository navigation
Conversation
…o delete schedules, all via Messenger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EventBridge Scheduler
Messages can be scheduled for future delivery using EventBridge Scheduler. This supports one-time and recurring schedules.
Design
sequenceDiagram participant App as Application participant Bus as Symfony Messenger Bus participant T as EventBridgeTransport participant EB as EventBridgeClient participant SC as SchedulerClient App->>Bus: dispatch(message, [SchedulerStamp]) Bus->>T: send(envelope) alt Has SchedulerStamp T->>SC: createSchedule(at(...), Target{Arn, Input, RoleArn}) SC-->>T: ScheduleArn else No SchedulerStamp T->>EB: putEvents(...) EB-->>T: PutEventsResponse end T-->>Bus: envelopeInstallation
Configuration
Add
target_arnandrole_arnto your EventBridge transport DSN:target_arn— The ARN of the Lambda function (or EventBridge bus) to invoke when the schedule firesrole_arn— The IAM role ARN that EventBridge Scheduler assumes to invoke the targetschedule_group— (optional) The schedule group name (defaults to AWSdefaultgroup)Usage
One-time schedule
Recurring schedule
Retrieving the schedule ID
Cancelling a schedule
Overriding target per message
The
SchedulerStampcan override the DSN-leveltarget_arnandrole_arn:How it works
When a
SchedulerStampis attached to a message, the transport creates an EventBridge Scheduler schedule instead of callingputEvents. The serialized message (including Symfony Messenger headers) is set as the schedule's target input, so the existing Bref consumer can decode it.at(...)) are automatically deleted by AWS after executionrate(...),cron(...)) persist until explicitly deletedSchedulerStamp, the transport behaves exactly as before (no breaking change)Key design decisions
async-aws/scheduleris a suggested dependency (not required) — the package works without it; a clearLogicExceptionis thrown if someone usesSchedulerStampwithout installing itActionAfterCompletion = DELETEfor one-time schedules,NONEfor recurringtarget_arn,role_arn,schedule_group) can be overridden per-message via the stamp