0

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?

10
  • Which version of quickfixn are you using? Maybe an older one that doesn't handle special characters or something like that? Looks strange. Commented Apr 1, 2023 at 17:34
  • I am referencing version 1.10.0 of QuickFIXn.Core and version 1.10.0 of QuickFIXn.FIX4.4 Commented Apr 3, 2023 at 13:48
  • This is quite strange. Are you able to review the message in a QF message log (NOT a debug print or console write-- never trust those!), and see what character is at the position indicated? Commented Apr 3, 2023 at 17:46
  • @GrantBirchmeier Yes. From QuickFix library I am using a CompositeLogFactory that contains a ScreenLogFactory and a FileLogFactory. The latest exception I got states "The input string '90NG Swing GDD Futures9063' was not in a correct format.", and I can see in both the screen and file outputs the message is genuinely incorrect - here is a section of the message found in the logs: "9071=390NG Swing GDD Futures9063=Natural Gas Swing Gas Daily Daily Futures" Commented Apr 3, 2023 at 19:39
  • 1
    Problem is most probably the ^A right after 9E. No tag=value. Commented Apr 4, 2023 at 17:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.