feat: add SessionStateListener callback when a PossDup message with too-low MsgSeqNum is discarded#1259
Open
mvanhorn wants to merge 3 commits into
Conversation
…oo-low MsgSeqNum is discarded Fixes quickfix-j#1254
Member
|
@mvanhorn thanks for the PR, will have a look... |
Wrap the raw session.getSessionID() argument in eq() so it is not mixed with the messageCaptor.capture() matcher in the same verify() call, which raised InvalidUseOfMatchersException. Add the ArgumentMatchers.eq import.
Author
|
Thanks @chrjohn. Fixed in Verified locally on JDK 21: the four |
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
SessionStateListenergains an observe-only callback,onPossDupMessageDiscarded(SessionID, Message), fired when a PossDupFlag=Y message is discarded by the session layer. The spec-mandated discard behavior (FIX session-layer test case 4.5.1(e)) is completely unchanged; applications that need to see these messages, like the GPW WATS case in #1254, can now observe them without forking the engine.Why this matters
@chrjohn confirmed in #1254 that the discard is spec-correct and will not change, and proposed exactly this: "some kind of handler or callback that is called on reception of a PossDup message ... I have nothing against putting in callbacks for messages that arrive in the engine anyway." The reporter confirmed a callback covers his use case and is currently running a private fork hack. The new method is a default on
SessionStateListener(all existing methods are defaults;onResendRequestSatisfiedis precedent for callbacks with context), invoked via the existingstateListenermultiplexer at the discard sites indoTargetTooLow()and the expected-seqnumvalidatePossDupfailure branch inverify(). The javadoc states the message was not processed by the application and must not be mutated.Testing
SessionTestgains cases for the too-low PossDup discard (callback fires, message untouched), the expected-seqnum OrigSendingTime failure (callback fires after the session Reject, target sequence advanced accordingly), and the no-callback path for normal messages. No Java runtime was available in the implementation environment, so CI is the verification run for the suite.Fixes #1254