Discussion Forums

Handling Custom/User Defined Messages in QuickFix
Kapil Singh / BrickRed <>
2 Jun 2009 10:57AM ET

Guys, need help on QuickFix.
We are a buyside firm and trading with a counter-party through FIX. Both are using QuickFix (.Net). We have mutually developed a few custom messages (user defined) e.g. Multi-leg orders in Fix4.2 (otherwise not supported in 4.2).
We have extented from QuickFix.Message Class (as all other classes in quickfix do). We are able to initialize and construct the custom message on outbound side and send to quick fix without any problem.

However on the inbound side, when we get the OnMessage event and try to cast Message into Custom Message Class, we are unable to cast it.
(We have taken care of dictionary etc)

Any thoughts?

e.g.

Buy Side:
FIX.NewOrderMultiLeg fixOrder = new FIX.NewOrderMultiLeg(); //custom message
Session.sendToTarget(fixOrder, sessionID); // works fine

Sell Side:
onMessage(QuickFix.Message message, QuickFix.SessionID session)
{
FIX.NewOrderMultiLeg _order = (FIX.NewOrderMultiLeg)message; // fails (unable to cast .net exception)
}

FIX.NewOrderMultiLeg is inheriting from QuickFix42.Message class of QuickFix.
Both buy side and sell side have the same implementation of FIX.NewOrderMultiLeg as well as QuickFix versions are same.


Handling Custom/User Defined Messages in QuickFix
Kapil Singh / BrickRed   2 Jun 2009 10:57AM ET
Re: Handling Custom/User Defined Messages in QuickFix
John Unwin / KaiTrade   2 Jun 2009 11:06AM ET