Carry the correlation id of the unit of work in an optional column. - #12
Closed
gustavofreze wants to merge 1 commit into
Closed
gustavofreze wants to merge 1 commit into
gustavofreze wants to merge 1 commit into
Conversation
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.
Summary
The outbox can now record, next to each event, the correlation id of the unit of work that emitted it. A consumer
that receives the event can then log it under the same id as the request that caused it, instead of starting a new
trace at every hop.
Columns::builder()->withCorrelationId(name:)enables an optional column. No column is written by default, soexisting tables and layouts keep producing exactly the same statement and the same eight bindings.
DoctrineOutboxRepositorytakes an optionalcorrelationIdreader, aClosure(): stringcalled at each write. Onerepository serves every request of a long-lived container, because the value is read when the row is written, not
when the repository is built.
NULL, which is what a worker outside any request writes. A reader without the column,or the column without a reader, writes nothing or
NULL, and never fails.occurred_at.Related issue
None.
Checklist
composer reviewpasses.composer testspasses.