quickfixj

QuickFIX/J - how to handle End Of Stream


I am new to QuickFIX/J.

Creating initiator using websocket(frontend-angular, backend-Springboot websocket). Using w.3.

I would like to handle session expired issue. When the FIX server session is expired, it is sending Logout with reason session deactivated. That works fine for already connected connection/session.

Now, after this, trying to initiate connection, it keeps calling back logout and toAdmin with repeating event/error on screen log (as event) "Disconnecting, End Of Stream encountered".

I would like to handle this scenario and want to capture this in my code so that proper message to UI will be sent.


Solution

  • I don't know which QuickFIX/J version you are using, but on versions up to 2.2.0 you could implement the quickfix.SessionStateListener in your application and utilize its onDisconnect() callback.

    If you are even using version 2.3.0 you could also use onConnectException() which will handle some additional scenarios that the first callback does not cover.