我正在编写一个程序,它向 ICE 发送安全定义请求(消息类型 35=c)并接收一系列安全定义响应消息(消息类型 35=d)。根据 NoRpts 标记,我知道我需要 166 条消息的序列,每条消息在一个重复组中包含 100 只证券。发生的情况是,通常我会正常收到前 4-6 条消息,然后 quickfixn 抛出如下所示的错误:
Session disconnecting: QuickFix.MessageParseError: Could not parse message: Error at position (38753) while parsing msg (<message string excluded for brevity>)
---> System.FormatException: The input string '90tural Gas Swing Gas Daily Daily Futures☺9032' was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
--- End of inner exception stack trace ---
at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
at QuickFix.Message.SetGroup(StringField grpNoFld, String msgstr, Int32 pos, FieldMap fieldMap, IGroupSpec groupDD, DataDictionary sessionDataDictionary, DataDictionary appDD, IMessageFactory msgFactory)
at QuickFix.Message.SetGroup(StringField grpNoFld, String msgstr, Int32 pos, FieldMap fieldMap, IGroupSpec groupDD, DataDictionary sessionDataDictionary, DataDictionary appDD, IMessageFactory msgFactory)
at QuickFix.Message.FromString(String msgstr, Boolean validate, DataDictionary sessionDD, DataDictionary appDD, IMessageFactory msgFactory, Boolean ignoreBody)
at QuickFix.MessageBuilder.Build()
at QuickFix.Session.Next(MessageBuilder msgBuilder)
at QuickFix.SocketInitiatorThread.ProcessStream()
at QuickFix.SocketInitiatorThread.Read()
基本上,出现在 2 个分隔符之间的字符串是“90tural Gas Swing Gas Daily Daily Futures”,这是无效的 FIX 消息语法(我相信这里的正确标记是 9063=Natural Gas Swing Gas Daily Daily Futures)
我们已经与我们正在连接的对方开立了支持票,他们的所有回复都表明他们发送的消息是正确的。此外,每次我运行它时,程序崩溃的消息编号总是不同,并且报告为无效的字符串总是不同,这让我认为这是与错误地从流中读取数据相关的一些暂时性问题。
有人对可能发生的事情或我如何进一步调试有任何建议吗?