Describe the bug
When a session is disabled (i.e. after calling logout()) it will no longer get reset as defined by its SessionSchedule. This is because next() returns early when a session is disabled:
|
public void next() throws IOException { |
|
|
|
if (!isEnabled()) { |
|
if (isLoggedOn()) { |
|
if (!state.isLogoutSent()) { |
|
getLog().onEvent("Initiated logout request"); |
|
generateLogout(state.getLogoutReason()); |
|
} |
|
} else { |
|
return; |
|
} |
|
} |
To Reproduce
Will try to create a unit test in due course.
Manual steps:
- have a session that is disabled and has not been used at the current day (i.e. there was no established session for that day)
- send messages to that Session via
sendToTarget() - the messages will end up in the Session's message store.
- establish a connection to the session
- based on QFJ's internal timer, the
next() method will be called within a second and a reset will be done, effectively removing the Sessions's message store
Expected behavior
Session should get reset based on its schedule even when it is disabled.
Describe the bug
When a session is disabled (i.e. after calling
logout()) it will no longer get reset as defined by itsSessionSchedule. This is becausenext()returns early when a session is disabled:quickfixj/quickfixj-core/src/main/java/quickfix/Session.java
Lines 1952 to 1963 in f8ba074
To Reproduce
Will try to create a unit test in due course.
Manual steps:
sendToTarget()- the messages will end up in the Session's message store.next()method will be called within a second and a reset will be done, effectively removing the Sessions's message storeExpected behavior
Session should get reset based on its schedule even when it is disabled.