I am using Quickfix/J version 2.3.0. The project is running fine on an environment but having the following issue on another one:
20230530-09:19:33: quickfix.SessionException Logon state is not valid for message (MsgType=y) 20230530-09:19:33: Already disconnected: Verifying message failed: quickfix.SessionException: Logon state is not valid for message (MsgType=y) 20230530-09:19:33: quickfix.SessionException Logon state is not valid for message (MsgType=y) 20230530-09:19:33: Already disconnected: Verifying message failed: quickfix.SessionException: Logon state is not valid for message (MsgType=y) 20230530-09:19:33: quickfix.SessionException Logon state is not valid for message (MsgType=y) 20230530-09:19:33: Already disconnected: Verifying message failed: quickfix.SessionException: Logon state is not valid for message (MsgType=y) 20230530-09:19:33: quickfix.SessionException Logon state is not valid for message (MsgType=f)
This situation is faced during multiple days, and it is not clear how to fix it, especially that the issue is not seen on other servers.
FIX configuration:
[default] ConnectionType=initiator ReconnectInterval=30 FileStorePath=logs/fix FileLogPath=logs/fix StartTime=00:00:00 StartDay=Sun EndTime=23:59:59 EndDay=Sat SocketConnectHost=****
[SESSION] BeginString=FIX.4.4 SenderCompID=**** TargetCompID=**** HeartBtInt=30 ResetOnLogon=Y UseDataDictionary=Y DataDictionary=FIX44.xml ValidateFieldsOutOfOrder=N ValidateUnorderedGroupFields=N SocketConnectHost=**** SocketConnectPort=**** CheckLatency=N
SocketUseSSL=Y CipherSuites=TLS_RSA_WITH_AES_128_CBC_SHA SocketKeyStore=**** SocketKeyStorePassword=**** KeyStoreType=PKCS12 EnabledProtocols=TLSv1
The problem was solved by running the REST API call that was made inside the fromAdmin() in a separate thread to prevent loss of logon messages in case the REST API call takes some time to finish.