[Quickfix-developers] Problem in Grouping
Brought to you by:
orenmnero
From: Parag T. <PT...@tc...> - 2003-07-18 09:12:25
|
Hi I am sending an Allocation message to FIX Engine. using version: FIX 1.5.0 C++ Problem: 1. Allocation message is received on engine side to its onMessage Callback if the number of groups added is 1. If I increase this grouping to 2 or more , no callback is invoked. In short FIX engine applications onMessage is not called. 2. Group not found error. When I send single group. I do get callback. But while reteriving group it throws exception FieldNotFound. Here is my Client Code & Server Code Client Code: void Application::queryAllocation() { int ordersCombined; FIX::TransactTime transTime(FIX::TransactTime()); FIX::AllocID aAllocID("123"); FIX::AllocTransType aAllocTransType(FIX::AllocTransType_NEW); FIX::Side aSide(FIX::Side_BUY); FIX::Symbol aSymbol("AllocationTest"); FIX::Shares aShares(100); FIX::AvgPx aAvgPx(111.11); FIX::TradeDate aTradeDate(transTime.getString().c_str()); FIX42::Allocation allocation = FIX42::Allocation( aAllocID,aAllocTransType, aSide,aSymbol, aShares,aAvgPx, aTradeDate ); string strSenderCompId = "CLIENT1"; string strTargetCompId = "TW"; allocation.getHeader().setField(FIX::SenderCompID(strSenderCompId)); allocation.getHeader().setField(FIX::TargetCompID(strTargetCompId)); allocation.setField(FIX::NoOrders(ordersCombined)); FIX42::Allocation::NoOrders noOrdersGroup; cout << endl << "Number of Orders:"; cin >> ordersCombined; for(int index=0; index <ordersCombined; index++) { string clorderId; cout << "ClOrder ID: " ; cin >> clorderId; noOrdersGroup.set(FIX::ClOrdID(clorderId)); allocation.addGroup(noOrdersGroup); } if ( queryConfirm( "Send Allocation" ) ) { FIX::Session::sendToTarget( allocation ); } } Server Side: void Application::onMessage( const FIX42::Allocation& message, const FIX::SessionID& sessionID) { FIX::NoOrders combinedOrdersCount; message.get(combinedOrdersCount); cout << combinedOrdersCount.getString() << endl; FIX42::Allocation::NoOrders group; //HERE IT THROWS EXCEPTION FIELDNOTFOUND message.getGroup(1,group); } I appreciate your helping me to resolve this issue Thanks Parag |