{{Quickfixn}} Crack Message from String

Gaull, James JGaull at ftportfolios.com
Mon Nov 4 08:22:55 PST 2013


I am having problems cracking a message that I retrieve from a Microsoft Message Queue as a string.  Below is code that is reading from the queue.  I am attempting to read a message that is an execution report.  My application is successfully reading a message from the queue and populating a QuickFIX.Message object.  I only get an exception once the Crack function is called.

MessageQueue msmqFromApp = new MessageQueue(Properties.Settings.Default.FromAppMessageQueueName);  // Create a queue object
msmqFromApp.Formatter = new XmlMessageFormatter(new Type[] { typeof(String) });                    // Set the queue format to string
QuickFix.Message rawMsg = new QuickFix.Message(msmqFromApp.Receive().Body.ToString());             // Create a QuickFIX Message and set it to the string received from the queue

QuickFIXEngine quickFIXEngine = new QuickFIXEngine();                // Instantiate QuickFixEngine class which implements QuickFIX.MessageCracker
quickFIXEngine.Crack(rawMsg, new SessionID("FIX.4.2", "F0001", "SG0001"));  // Call the Crack function


Here's the value of rawMsg.ToString():
8=FIX.4.29=20835=834=349=SG000152=20131104-15:52:02.55356=F00016=89.245421476310811=2314=100017=220=022=131=89.245421476310832=100037=238=100039=240=548=45920010154=155=IBM                       150=2151=010=092

Here's the error I receive:   Exception of type 'QuickFix.UnsupportedMessageType' was thrown.

Below is the code in the QuickFIXEngine class that handles the cracked messages.  I have a function that handles FIX42.ExecutionReport messages.

public void OnMessage(QuickFix.FIX40.ExecutionReport msg, QuickFix.SessionID sessionID) { }
public void OnMessage(QuickFix.FIX41.ExecutionReport msg, QuickFix.SessionID sessionID) { }
public void OnMessage(QuickFix.FIX42.ExecutionReport msg, QuickFix.SessionID sessionID) { }
public void OnMessage(QuickFix.FIX43.ExecutionReport msg, QuickFix.SessionID sessionID) { }
public void OnMessage(QuickFix.FIX44.ExecutionReport msg, QuickFix.SessionID sessionID) { }
public void OnMessage(QuickFix.FIX50.ExecutionReport msg, QuickFix.SessionID sessionID) { }
.
.
.

Any ideas on what could be wrong?

Thanks and sorry for the long message!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20131104/ebb183c9/attachment.htm>


More information about the Quickfixn mailing list