I am writing a program which sends a security definition request to ICE (message type 35=c) and receives a series of security definition response messages (message type 35=d). Based on the NoRpts tag, I know I am expecting a sequence of 166 messages, each of which contain 100 securities in a repeating group. What is happening is that typically I will receive the first 4-6 messages fine, and then quickfixn throws an error that looks like this:
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()
Basically the string that appears between 2 delimiter characters is "90tural Gas Swing Gas Daily Daily Futures", which is not valid FIX message syntax (I believe the correct tag here is 9063=Natural Gas Swing Gas Daily Daily Futures)
We have opened support tickets with our counter party we are connecting to, and all of their responses indicate that the messages they are sending on their end are correct. Also, every time I run it, it's always a different message number that the program crashes on and it's always a different string that is reported as invalid, which makes me think it's some transient issue associated with reading the data off the stream incorrectly.
Does anyone have any suggestions related to what might be happening or how I can debug this further?