Quickfixj: difference between exit methods
The exit method is the way to go. It will change the enabled flag, which will call the method public void next()
called by the timer. This will use the method generateLogout()
to send the correct FixMessage (35 = 5). The generateLogout methods are private, except those that have no parameters that have been changed to public with a changeset for no reason, so I guess this happens unexpectedly as it is just a helper method for generating a message. It's the same for login which you call public void logon()
which changes state and public void next()
which calls which calls private void generateLogon()
.
source to share
First of all, by looking at the Javadoc for QuickFIX / J, you could argue that this is a lack of information required for the methods you choose between.
My recommendation for you is to look at the source code for this project and compare the methods (one of the benefits of open source software).
Briefly, see below the differences between the methods,
The method logout()
only callssetEnabled(false)
while
generateLogout(Message otherLogout, String text, SessionStatus sessionStatus)
causes all sorts of things. For example, it prepares a logout message, sets the session status, etc.
Overall, it seems that the method generateLogout()
is the more correct way to log out.
source to share