我的QuickFIX客户端在每天登录前发送注销。是否有可能在登录前不发送此注销消息…?
下面是我现在使用的设置:
[default]
FileStorePath=/home/quickfix/crons/exe/quickfix/filestore
ConnectionType=initiator
SenderCompID=TN7_42
TargetCompID=EMS
SocketConnectHost=xxxxx
TimeZone=Asia/Tokyo
StartTime=07:50:00 Asia/Tokyo
EndTime=20:00:00 Asia/Tokyo
HeartBtInt=30
ReconnectInterval=5
CheckLatency=N
UseLocalTime=Y
[session]
BeginString=FIX.4.2
SocketConnectPort=12061
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y
RefreshOnLogon=N
. .以下是我每天收到的日志信息:
Oct 11, 2011 7:56:00 AM quickfix.SessionSchedule <init>
INFO: [FIX.4.2:TN7_42->EMS] daily, 22:50:00-UTC - 11:00:00-UTC
<20111010-22:56:00.820, FIX.4.2:TN7_42->EMS, event> (Session FIX.4.2:TN7_42->EMS schedule is daily, 22:50:00-UTC - 11:00:00-UTC)
<20111010-22:56:00.821, FIX.4.2:TN7_42->EMS, event> (Session state is not current; resetting FIX.4.2:TN7_42->EMS)
<20111010-22:56:00.821, FIX.4.2:TN7_42->EMS, event> (Created session: FIX.4.2:TN7_42->EMS)
Oct 11, 2011 7:56:00 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketTcpNoDelay=true
Oct 11, 2011 7:56:00 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketSynchronousWrites=false
Oct 11, 2011 7:56:00 AM quickfix.mina.NetworkingOptions logOption
INFO: Socket option: SocketSynchronousWriteTimeout=30000
Oct 11, 2011 7:56:00 AM quickfix.mina.initiator.IoSessionInitiator <init>
INFO: [FIX.4.2:TN7_42->EMS] [/xxxxx:12061]
Oct 11, 2011 7:56:00 AM quickfix.mina.SessionConnector startSessionTimer
INFO: SessionTimer started
Oct 11, 2011 7:56:00 AM quickfix.mina.initiator.InitiatorIoHandler sessionCreated
INFO: MINA session created for FIX.4.2:TN7_42->EMS: local=/xxxxx:48477, class org.apache.mina.transport.socket.nio.SocketSessionImpl, remote=/xxxxx:12061
<20111010-22:56:01.860, FIX.4.2:TN7_42->EMS, outgoing> (8=FIX.4.2^A9=52^A35=5^A34=1^A49=TN7_42^A52=20111010-22:56:01.859^A56=EMS^A10=085^A)
Oct 11, 2011 7:56:01 AM quickfix.Session disconnect
INFO: [FIX.4.2:TN7_42->EMS] Disconnecting: Session reset
Oct 11, 2011 7:56:05 AM quickfix.mina.initiator.InitiatorIoHandler sessionCreated
INFO: MINA session created for FIX.4.2:TN7_42->EMS: local=/xxxxx:48478, class org.apache.mina.transport.socket.nio.SocketSessionImpl, remote=/xxxxx:12061
<20111010-22:56:06.844, FIX.4.2:TN7_42->EMS, outgoing> (8=FIX.4.2^A9=70^A35=A^A34=1^A49=TN7_42^A52=20111010-22:56:06.844^A56=EMS^A98=0^A108=30^A141=Y^A10=166^A)
<20111010-22:56:06.845, FIX.4.2:TN7_42->EMS, event> (Initiated logon request)
<20111010-22:56:06.847, FIX.4.2:TN7_42->EMS, incoming> (8=FIX.4.2^A9=179^A35=5^A49=EMS^A56=TN7_42^A34=1^A43=N^A52=20111010-22:56:06.846^A58=Catastropic Error: Incoming sequence number (1) is less than expected (2) without PossDupFlag being set. Logging out.^A10=226^A)
Oct 11, 2011 7:56:06 AM quickfix.Session disconnect
INFO: [FIX.4.2:TN7_42->EMS] Disconnecting: IO Session closed
<20111010-22:56:06.849, FIX.4.2:TN7_42->EMS, error> (quickfix.SessionException Logon state is not valid for message (MsgType=5))
<20111010-22:56:06.849, FIX.4.2:TN7_42->EMS, event> (Already disconnected: Verifying message failed: quickfix.SessionException: Logon state is not valid for message (MsgType=5))
<20111010-22:56:10.887, FIX.4.2:TN7_42->EMS, error> (java.net.ConnectException: java.net.ConnectException: Connection refused(Next retry in 5000 milliseconds))
<20111010-22:56:15.898, FIX.4.2:TN7_42->EMS, error> (java.net.ConnectException: java.net.ConnectException: Connection refused(Next retry in 5000 milliseconds))
你正在被bug QFJ-357所叮咬,尽管它是针对Java项目的,但它似乎也是直接c++版本的问题。
这个问题实际上已经在c++的主干中通过2269版的修正得到了修复。
传入序列号低于预期
这说明了一切。在FIX消息中发送给接受者的序列号与接受者期望的序列号不同,因此强制下线消息。这样做主要是为了在发送和接收消息时保持接受者和发起者同步。
配置中有一个标志,提到在连接期间重置所有序列号。使用该标志可以暂时解决这个问题,但最好还是坚持使用原始序列号。在拒绝消息中,您应该获得接受者所期望的序列号。解析序列号,然后再次启动登录过程。
尝试将会话结束时间提前一点,并确认您实际上是在发送由于到达结束时间而发出的注销,而不仅仅是在未注销的情况下终止应用程序。
在QuickFIX中也有一两个在1.12中不存在的错误,所以你可以尝试旧版本,看看它是否更适合你。