{{Quickfixn}} QuickFix v 1.3 - Cracker throwing unsporrted message type

James A. Smith jsmith at anstca.com
Mon Feb 25 13:15:03 PST 2013


I am new to QuickFix/N and have a basic program running based on the
example for receiving messages from the documentation below.   Inside my
FromApp() method I print out the message type which I get:

 

QuickFix.FIX42.ExecutionReport

 

But when Crack() tries to crack the message, I get an exception thrown:

 

Unknown message type

 

You can see I have the onMessage(QuickFix.FIX42.ExecutionReport message,
SessionID session) method defined, but Crack doesn't seem to recognize
it?  There must be something trivial I am doing wrong?

 

Thanks,

James

 

using System;

using QuickFix;

using QuickFix.Fields;

 

public class MyQuickFixApp : QuickFix.MessageCracker,
QuickFix.Application

{

    public void FromApp(Message msg, SessionID sessionID) 

    {

        System.Console.WriteLine("FromApp : MsgType:" + msg.GetType());

        try

        {

            Crack(msg, sessionID);

        } catch(Exception e) {

            System.Console.WriteLine(e.Message);

        }

        

    }

    public void OnCreate(SessionID sessionID) {   }

    public void OnLogout(SessionID sessionID) {  }

    public void OnLogon(SessionID sessionID) {  }

    public void FromAdmin(Message msg, SessionID sessionID) {  }

    public void ToAdmin(Message msg, SessionID sessionID) {  }

    public void ToApp(Message msg, SessionID sessionID) {  }

 

    public void onMessage(QuickFix.FIX42.ExecutionReport message,
SessionID session)

    {

        System.Console.WriteLine("OrderStutus:" + message.OrdStatus);

        System.Console.WriteLine(message.ToString());

        

    }

}

 

public class MyApp

{

    static void Main(string[] args)

    {

        System.Console.WriteLine("init...");

        SessionSettings settings = new SessionSettings(args[0]);

        Application myApp = new MyQuickFixApp();

        MessageStoreFactory storeFactory = new
FileStoreFactory(settings);

        LogFactory logFactory = new FileLogFactory(settings);

        ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(

            myApp,

            storeFactory,

            settings,

            logFactory);

 

        acceptor.Start();

        while (true)

        {

            //System.Console.WriteLine("o hai");

            System.Threading.Thread.Sleep(1000);

        }

        acceptor.Stop();

    }

}

 

 

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


More information about the Quickfixn mailing list