Re: [Quickfix-developers] QuickFix repeating group issue
Brought to you by:
orenmnero
From: Chris B. <cb...@co...> - 2008-06-09 17:35:46
|
Hi Neeraj, Check out the documentation regarding repeating groups located here: http://www.quickfixengine.org/quickfix/doc/html/repeating_groups.html There you will find safer ways of creating and receiving messages with repeating groups. Chris. On Jun 9, 2008, at 12:22 PM, Gehani, Neeraj wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Does any of you have experience with Quickfix. I am trying to do the > following > > 1) create a NewOrderList with repeating groups. > 2) Send it over wire. > 3) Receive it and convert it back into a NewOrderList > 4) getGroup from the message ( that all fails with exceptions > > In the step #3 when I create the QuickFix44.NewOrderList out of > Payload, it just flattens out the repeating group into almost a > sorted output ( leaving aside the header and footer of the fix > message intact). What the right way of doing this? Any help > appreciated. > > 2008-06-09 10:58:34,475 [EMS Session Dispatcher (2556)] DEBUG > msgString = 8=FIX. > 4.49=26335=E66=Portfolio168=673=61=ABC11=FAA: > 153=110054=155=A67=11=ABC11=FAA: > 253=220054=155=B67=21=ABC11=FAA: > 353=330054=155=C67=31=XYZ11=FAA: > 453=440054=255=D67=41=XYZ11=FAA: > 553=550054=255=E67=51=XYZ11=FAA: > 653=660054=255=F67=6394=210=192 > > FixList = 8=FIX. > 4.49=26335=E1=ABC1=ABC1=ABC1=XYZ1=XYZ1=XYZ11=FAA:111=FAA: > 211=FAA:311=FAA:411=FAA:511=FAA: > 6 > > 53 > = > 1100 > > 53 > = > 2200 > > 53 > = > 3300 > > 53 > = > 4400 > > 53 > = > 5500 > > 53 > = > 6600 > > 54 > = > 1 > > 54 > = > 1 > > 54 > = > 1 > > 54 > = > 2 > > 54 > = > 2 > > 54 > = > 2 > > 55 > = > A > > 55 > = > B > > 55 > = > C > > 55 > = > D > > 55 > = > E > > 55 > =F66=Portfolio167=167=267=367=467=567=668=673=6394=210=192 > > Here is the code that recieves a message. > > QuickFix44.NewOrderList fixList = new > QuickFix44.NewOrderList(); > fixList.setString( (msgString); > DebugFormat("msgString = {0} \n\n FixList = {1}", > requestMessage.Payload, fixList.ToString()); > > Creation is done by > > public static string createNewOrderList(){ > QuickFix44.NewOrderList newOrderList = new > QuickFix44.NewOrderList(); > > QuickFix.ListID listId= new QuickFix.ListID("Portfolio1"); > newOrderList.setField(listId); > > QuickFix.BidType bidType = new > QuickFix.BidType(QuickFix.BidType.DISCLOSED_STYLE); > newOrderList.setField(bidType); > > int totNumberOfOrders = 6; > newOrderList.setField(new > QuickFix.TotNoOrders(totNumberOfOrders)); > > //Orders list as repeating group > > QuickFix.Account account1 = new QuickFix.Account("ABC"); > QuickFix.Account account2 = new QuickFix.Account("XYZ"); > QuickFix.Quantity quantity = new QuickFix.Quantity(1100); > QuickFix.Side side = new QuickFix.Side('1'); > int ascii = 65; > char symbol = Convert.ToChar(ascii); > String clOrderId = "FAA:"; > > for ( int i =0;i< totNumberOfOrders;i++){ > > QuickFix.Group sequenceGroup = new > QuickFix.Group(73,50); > sequenceGroup.setField(new > QuickFix.ClOrdID(clOrderId + (i + 1))); > sequenceGroup.setField(new QuickFix.ListSeqNo(i + 1)); > sequenceGroup.setField(new QuickFix.Quantity(1100*(i > +1))); > sequenceGroup.setField(new > QuickFix.Symbol(symbol.ToString())); > > if (i < totNumberOfOrders / 2) > { > sequenceGroup.setField(new QuickFix.Side('1')); > sequenceGroup.setField(account1); > } > else > { > sequenceGroup.setField(new QuickFix.Side('2')); > sequenceGroup.setField(account2); > } > > SoupLogger.getLogger().DebugFormat("Group = {0}", > sequenceGroup.ToString()); > newOrderList.addGroup(sequenceGroup); > symbol = Convert.ToChar(++ascii); > } > > return newOrderList.ToString(); > } > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php_______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |