[Quickfix-users] Can't Crack a message created from the MessageStore
Brought to you by:
orenmnero
From: abaraff <ab...@ra...> - 2011-05-17 19:01:29
|
I'd like to reprocess all the existing messages I've previously received when starting a session. I've tried both directly calling crack() on them as well as forcing them through my fromApp callback. Either way I get UnsupportedMessageType exceptions on MessageTypes that I have onMessage methods for--it's important to note that all the code works fine when QuickFIX initially sends these messages in via the fromApp method. My onCreate method looks like this: public void onCreate(SessionID sessionID) { MessageStore ms = Session.lookupSession(sessionID).getStore(); System.Collections.ArrayList messages = new System.Collections.ArrayList(); ms.get(1, Math.Max(ms.getNextSenderMsgSeqNum() - 1, ms.getNextTargetMsgSeqNum() - 1), messages); System.Diagnostics.Debug.WriteLine(messages.Count + " found for " + sessionID.ToString()); foreach (string message in messages) { Message msg = new Message(message); MsgType type = new MsgType(); msg.getHeader().getField(type); System.Diagnostics.Debug.WriteLine(type.ToString()); System.Diagnostics.Debug.WriteLine(msg.isAdmin() + "\t" + msg.getHeader().getInt(MsgSeqNum.FIELD) + "\t" + type.ToString()); fromApp(msg, sessionID); } System.Diagnostics.Debug.WriteLine("OnCreate:" + sessionID.ToString()); } fromApp looks like this: public void fromApp(Message msg, SessionID sessionID) { System.Diagnostics.Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.FFFF") + " FromApp:" + sessionID.ToString() + "\t" + msg.ToString()); try { crack(msg, sessionID); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } } And I have the following cracker overrides: public override void onMessage(QuickFix42.ExecutionReport message, SessionID session) { System.Diagnostics.Debug.WriteLine("Execution Report"); } public override void onMessage(QuickFix42.OrderCancelReject message, SessionID session) { System.Diagnostics.Debug.WriteLine("Cancel Rejected"); } public override void onMessage(QuickFix42.Reject message, SessionID session) { System.Diagnostics.Debug.WriteLine("Something Rejected"); } public override void onMessage(QuickFix42.ResendRequest message, SessionID session) { System.Diagnostics.Debug.WriteLine("Resend Requested"); } public override void onMessage(QuickFix42.NewOrderSingle message, SessionID session) { System.Diagnostics.Debug.WriteLine("New Order Single"); } Here is some of the output(D is NewOrderSingle and I have an onMessageMethod for NewOrderSingle): D False 2 D 14:40:00.5585 FromApp:FIX.4.2:SCTC->DBSI 8=FIX.4.29=18035=D34=249=SCTC52=20110517-17:38:46.77656=DBSI11=SCT20110517-133846_0000018=121=138=20040=154=155=IBM58=SCT20110517-133846_0000059=060=20110517-13:38:46100=DB-SMART10=040 A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred in quickfix_net_messages.dll QuickFix.UnsupportedMessageType: Exception of type 'QuickFix.UnsupportedMessageType' was thrown. at QuickFix42.MessageCracker.onMessage(Message message, SessionID session) at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID) at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 209 D False 3 D 14:40:00.5742 FromApp:FIX.4.2:SCTC->DBSI 8=FIX.4.29=18035=D34=349=SCTC52=20110517-17:38:49.93356=DBSI11=SCT20110517-133849_0000118=121=138=20040=154=255=IBM58=SCT20110517-133849_0000159=060=20110517-13:38:49100=DB-SMART10=051 A first chance exception of type 'QuickFix.UnsupportedMessageType' occurred in quickfix_net_messages.dll QuickFix.UnsupportedMessageType: Exception of type 'QuickFix.UnsupportedMessageType' was thrown. at QuickFix42.MessageCracker.onMessage(Message message, SessionID session) at QuickFix42.MessageCracker.crack(Message message, SessionID sessionID) at FIXServer.FIXServerApp.fromApp(Message msg, SessionID sessionID) in C:\Dev\Abaraff\FIXServer\FIXServer\FIXServerApp.cs:line 209 -- View this message in context: http://old.nabble.com/Can%27t-Crack-a-message-created-from-the-MessageStore-tp31640827p31640827.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |