quickfixj icon indicating copy to clipboard operation
quickfixj copied to clipboard

`quickfix.ApplicationExtended#onBeforeSessionReset(SessionID)` called only if session has responder and is logged on

Open simenflatby opened this issue 4 years ago • 1 comments

Describe the bug quickfix.ApplicationExtended#onBeforeSessionReset(SessionID) is called only if the session has a responder and is logged on.

To Reproduce Setup an application with StartTime and EndTime and wait for quickfix.Session#reset() to get called by quickfix.Session#resetIfSessionNotCurrent(SessionID, long) before logging on when entering StartTime with a non current session.

Expected behavior quickfix.ApplicationExtended#onBeforeSessionReset(SessionID) gets called even if the session is not logged on. Proposed solution: Move the call to quickfix.ApplicationExtended#onBeforeSessionReset(SessionID) to the top of the try block.

system information:

  • OS: CentOS
  • Java version: JDK8
  • QFJ Version: 2.2.0

Additional context Not sure if this qualifies as a bug or if it actually works as intended. Please discard and close the issue if it works as intended.

simenflatby avatar Oct 22 '20 15:10 simenflatby

I also think onBeforeSessionReset(SessionID) should be called when a session is not logged on. It can happen that messages are put to the store without an active session. In my opinion this is rather common. Moreover I am asking myself if this callback would be better off in the SessionStateListenerobject which has similar callbacks already. For example onReset() which is called after reset which makes it impossible to do any stuff with the content of the MessageStore before it is getting reset.

chrjohn avatar May 12 '21 11:05 chrjohn