{{Quickfixn}} Using QuickFix on a flat file

Ted Tworek ttworek at theleaguecorp.com
Tue Sep 11 18:37:39 PDT 2012


Hi,

 

I'm trying to read the static securities definition file from the CME,
located at: <ftp://ftp.cmegroup.com/fix/Production/secdef.dat.gz>
ftp://ftp.cmegroup.com/fix/Production/secdef.dat.gz

Since they seem to be standard fix messages, I thought I could use QuickFix
to help me read them into C# rather than parsing the file myself. I created
a test app that basically does what I want, but I'm having 2 issues:

1) I'm getting a QuickFix exception "Invalid message: Header fields out of
order" when forming the message from the string. If I set the "validate"
boolean to false, this message disappears and the constructor succeeds, but
may be an indicator for the next issue.

2) Upon calling p.Crack, I'm getting the QuickFix exception
"QuickFix.UnsupportedMessageType", but there doesn't seem to be any
indication of what the message type is that is supposedly unsupported.

Anyway, maybe QuickFix wasn't intended to be used in this way, but any ideas
on how to get this to work?

Thanks,

Ted

 

using System;

using System.IO;

using System.Collections.Generic;

using System.Text;

using QuickFix;

 

namespace TestQuickFix

{

    class Program : QuickFix.MessageCracker

    {

        static void Main(string[] args)

        {

            int count = 0;

            string line;

 

            Program p = new Program();

            StreamReader file = new StreamReader(@"C:\secdef.dat");

 

            while (((line = file.ReadLine()) != null && count < 10))

            {

                // ISSUE #1 REQUIRES false 2ND ARG WHEN CREATING THE MESSAGE

                Message m = new Message(line, false); 

 

                // ISSUE #2 Exception of type
'QuickFix.UnsupportedMessageType' was thrown.

                p.Crack(m, new SessionID("beginString", "senderCompID",
"targetCompID"));

            }

 

            file.Close();

 

        }

 

        public void OnMessage(QuickFix.FIX50.SecurityDefinition secDef,
SessionID sessionID)

        {

            Console.WriteLine(secDef.ToString());

        }

    }

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120911/f4337105/attachment.htm>


More information about the Quickfixn mailing list