QUEUE-144: Support context listeners in marshallable outputs - #1273
Closed
peter-lawrey wants to merge 1 commit into
Closed
peter-lawrey wants to merge 1 commit into
peter-lawrey wants to merge 1 commit into
Conversation
This was referenced Aug 7, 2026
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-context-listener-lifecycle
branch
from
August 7, 2026 09:23
10d25f3 to
fd1fcb2
Compare
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-marshallable-out-listeners
branch
from
August 7, 2026 09:23
d08212f to
65323d6
Compare
peter-lawrey
marked this pull request as ready for review
August 7, 2026 12:52
There was a problem hiding this comment.
Pull request overview
Routes wire context-listener configuration through additional MarshallableOut implementations (string-consumer, file, HTTP) so context records can be emitted consistently across supported outputs and output-context lifecycles.
Changes:
- Add
contextListener(..)support toStringConsumerMarshallableOut,FileMarshallableOut(append-only), andHTTPMarshallableOutby delegating to the underlyingWire. - Update HTTP output lifecycle to treat each POST as a fresh output context (
wire.reset()between successful POSTs) and expose a per-POSTcontextCount(). - Add integration tests covering string-consumer, append-file, overwrite-file rejection, and HTTP POST behaviour.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/java/net/openhft/chronicle/wire/MarshallableOutContextListenerTest.java | Adds coverage for context-listener behaviour across string-consumer, file (append/overwrite), and HTTP outputs. |
| src/main/java/net/openhft/chronicle/wire/internal/StringConsumerMarshallableOut.java | Wires MarshallableOut.contextListener(..) through to the underlying Wire. |
| src/main/java/net/openhft/chronicle/wire/internal/HTTPMarshallableOut.java | Adds per-POST output-context counting and resets the Wire between successful POSTs; wires through contextListener(..). |
| src/main/java/net/openhft/chronicle/wire/internal/FileMarshallableOut.java | Supports contextListener(..) in append mode and rejects it in overwrite mode with a clear exception. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tgd
approved these changes
Aug 10, 2026
This was referenced Aug 11, 2026
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-context-listener-lifecycle
branch
from
August 11, 2026 09:07
3c4a997 to
5ab7b18
Compare
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-marshallable-out-listeners
branch
from
August 11, 2026 09:21
96f45ed to
adba541
Compare
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-marshallable-out-listeners
branch
from
August 11, 2026 10:53
adba541 to
9460790
Compare
peter-lawrey
force-pushed
the
feature/QUEUE-144-wire-context-listener-lifecycle
branch
from
August 11, 2026 10:53
5ab7b18 to
751df01
Compare
benbonavia
approved these changes
Aug 24, 2026
This was referenced Aug 27, 2026
Member
Author
|
Closed as deferred rather than merged. #1280 retains the supported Wire listener boundary while excluding the deferred adapter scope from this release. |
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
contextListener(...)for append-mode file, string-consumer, and HTTPMarshallableOutimplementations.Purpose
#1272 implements once-per-output-context listener notification on writable Wire instances. The wrappers changed here must define what an output context means for their destination and pass listener registration to the backing Wire.
Without this adapter-specific handling, HTTP can send later standalone requests without the context required to interpret them, while overwrite-mode files can appear to support context listeners even though the surviving file no longer contains that context.
Lifecycle decisions
Stack position
This PR is stacked on #1272 and deliberately contains only concrete
MarshallableOutadapter behaviour. It does not change the shared listener API or the core Wire lifecycle.#1274 documents the completed Wire contract, and OpenHFT/Chronicle-Queue#1725 applies the same API to Queue roll cycles.
Review focus
Review the chosen output-context boundaries, HTTP open/close counting, reset-versus-clear behaviour, overwrite-file rejection, and the full-output assertions.
Validation
mvn -q -Dtest=DocumentContextLifecycleTest,MarshallableOutContextListenerTest testmvn -q clean verify