Conversation
QueueManager::push() accepts a metadata option recorded on the message body as a sibling of data, Message::getMetadata() exposes it, and failed jobs persist it through store and requeue.
markstory
reviewed
Sep 25, 2026
| public function change(): void | ||
| { | ||
| $table = $this->table('queue_failed_jobs'); | ||
| $table->addColumn('metadata', 'text', [ |
Member
There was a problem hiding this comment.
If you're storing JSON in the column, why not use a json type? That would save you having to manually encode JSON when persisting/accessing entity data.
Member
Author
There was a problem hiding this comment.
Completely agree, but I was trying to be consistent with current data column in exists migration.
Member
There was a problem hiding this comment.
I think those columns predated proper JSON column support in the ORM.
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.
Add metadata envelope to Queue messages
Allows bookkeeping fields (
tags,_uniqueId,batch_id) to travel next to the job payload instead of inside it, sodatastays pure and DTO-safe.Why this is needed:
$data['tags'] = ...,$data['_uniqueId'] = ...). That blocks DTO objects (array writes on an object), pollutes monitoring data, and leaks mutator keys intoMessage::getDto()hydration.properties/headerscannot hold it:FailedJobsListenerpersists onlydata+requeueOptionsto the database, so anything stored in properties is silently lost on failure and requeue.requeueOptionscannot hold it either: that key is routing (config,priority,queue), mapped toFailedJobsTablecolumns and read byqueue requeue. Mixing domain envelope data into routing breaks that contract.Key Features:
QueueManager::push()now accepts ametadataoption (array) and records it on the message body as a sibling ofdata. Omitted when empty or not an array.Message::getMetadata()returns the envelope array .getArgument()is unchanged and returns the pure payload.metadatacolumn onqueue_failed_jobs(migrationAddMetadataToFailedJobs),FailedJobsListenerpersists it,RequeueCommandpasses it back intopush()viaFailedJob::decoded_metadata.Usage: