sink/periodic-jobs: deliver and report one item at a time (DI-3015) - #323
Merged
jbndbc merged 1 commit intoSep 15, 2026
Conversation
Migrate the sink from MessageConsumerAdapter to SinkMessageConsumerAdapter. job-store now dispatches one JMS message per item, and the sink implements deliverItem(ConsumedMessage, ChunkItem) instead of assembling a DELIVERED chunk. Header reading, result reporting and the tracking-id scope move to the framework. The sink aggregates a whole job before delivering anything, so it overrides usesDeliveryWatermark() to false. It still reports every item individually, since the DELIVERING counters and the per-job gate are driven by those reports. The job termination item arrives as an ordinary item message carrying ChunkItem.Type.JOB_END. Drop the five second sleep that preceded finalization. It guessed at a window the chunk protocol opened by reporting the result before committing the sink's own transaction. deliverItem commits first and the framework reports afterwards, so a reported item is an item whose datablocks are durable and the termination chunk is released only against complete data. InvalidMessageException from finalization is now reported as a FAILED termination item rather than discarding the message, which completes the job and sets its fatal error flag instead of leaving it forever incomplete.
ja7
reviewed
Sep 14, 2026
ja7
left a comment
Contributor
There was a problem hiding this comment.
Hvordan i forhold til
it rolls the JMS session back and the item is redelivered until the broker gives up
Jeg er ikke sikker på hvordan vi håndtere det i dag. ( er det JobStore der arbonere på DeadMessageQueue ? )
ja7
approved these changes
Sep 14, 2026
Contributor
Author
Ja, det er samme mekanisme som i det nuværende, bare lavet om til at fungere på item niveau i stedet for chunk niveau. Den funktionalitet lå i et tidligere PR. |
jbndbc
merged commit Sep 15, 2026
b584a39
into
DBCPR-328-dataio-chunk-scheduling-redesign
1 of 2 checks passed
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.
Migrate the sink from MessageConsumerAdapter to SinkMessageConsumerAdapter. job-store now dispatches one JMS message per item, and the sink implements deliverItem(ConsumedMessage, ChunkItem) instead of assembling a DELIVERED chunk. Header reading, result reporting and the tracking-id scope move to the framework.
The sink aggregates a whole job before delivering anything, so it overrides usesDeliveryWatermark() to false. It still reports every item individually, since the DELIVERING counters and the per-job gate are driven by those reports. The job termination item arrives as an ordinary item message carrying ChunkItem.Type.JOB_END.
Drop the five second sleep that preceded finalization. It guessed at a window the chunk protocol opened by reporting the result before committing the sink's own transaction. deliverItem commits first and the framework reports afterwards, so a reported item is an item whose datablocks are durable and the termination chunk is released only against complete data.
InvalidMessageException from finalization is now reported as a FAILED termination item rather than discarding the message, which completes the job and sets its fatal error flag instead of leaving it forever incomplete.