Search code examples
fix-protocol

"QuickFix.UnsupportedMessageType" exception was thrown, when the "onMessage" crack was present


I'm not quite sure why it happened. I request Market Data Request (with 263=1) and the counterparty gave response with (absolutely) MarketDataSnapshotFullRefresh (35=W). I've included the onMessage(QuickFix.FIX42.MarketDataSnapshotFullRefresh ...) on my message's cracker.. But the app has thrown the exception "QuickFix.UnsupportedMessageType"...

So, I tried to capture the SnapshotMarketData directly from "FromApp" (without Message Cracker) and it successfully done. So what's the matter with my message's cracker? Any idea?

This is the "FromApp" currently..

public void FromApp(QuickFix.Message msg, SessionID sessionID) //every inbound Application-level message
    {
        if (msg.Header.GetField(Tags.MsgType) == MsgType.MARKET_DATA_SNAPSHOT_FULL_REFRESH)
            Homepage._homepage.GetFixMessage(msg.ToString());
        else
            Crack(msg, sessionID);
    }

And this is the Message Cracker previously (before I capture directly from "FromApp"

#region MessageCracker handlers
    public void onMessage(QuickFix.FIX42.MarketDataSnapshotFullRefresh mdsnapshot, SessionID s)
    {
        Homepage._homepage.GetFixMessage(mdsnapshot.ToString());
    }
    #endregion

Solution

  • OnMessage needs to start with a capital "O".

    QF/n uses the C# convention of capitalizing method names.