[Quickfix-developers] nested groups inside MassQuote message
Brought to you by:
orenmnero
From: Joy B. <jo...@cy...> - 2004-08-18 13:16:45
|
i am still having problem using inner (nested) groups. Here is a = detailed discription of what i am doing. I am using quickfix-1.8.0 and = FIX 44 version on windows platform. I have written the client and the = server in c++. I am having problem handling MassQuote message since it = has a group (NoQuoteEntries) nested within another group (NoQuoteSets).=20 I have the following questions: 1. Does the user enter values for fields like TotNoQuoteEntries and = NoQuoteEntries? If not, then on the client side are these fields to be set with = empty objects of TotNoQuoteEntries and NoQuoteEntries? OR Are these = fields not to be set at all?=20 How does one handle these two fiels on the client side? And how = does QuickFix generate values for these fields? It seems in my case "NoQuoteSets" is having no problem in = generating the proper value even without the need to set it on the = client side but but the same does not seem to be happening in case of = TotNoQuoteEntries and NoQuoteEntries (i.e it does not get any value = unless it is set on the client side ). Please have a look at the code = provided below. 2. i am getting the following output on the server side: <20040818-11:49:16, FIX.4.4:TW->CLIENT1, incoming> = (8=3DFIX.4.4=E2=98=BA9=3D75=E2=98=BA35=3Di=E2=98=BA34=3D95=E2=98=BA49=3DC= LIENT1=E2=98=BA52=3D20040818-11:49:16.000=E2=98=BA56=3DTW=E2=98=BA117=3DI= Dq=E2=98=BA296=3D1=E2=98=BA302=3DIDs=E2=98=BA10=3D158=E2=98=BA) MassQuote Msg received from client QuoteID=3D IDq NoQuoteSets=3D 1 QuoteSetID=3D IDs have defined noQuoteEntriesGroup1 TotNoQuoteEntries=3D NoQuoteEntries=3D <20040818-11:49:16, FIX.4.4:TW->CLIENT1, event> (Message 95 Rejected: Required tag missing:295) (NOTE: TotNoQuoteEntries and NoQuoteEntries have not generated any = values) The server side program seems to be throwing an exception at the = following line :=20 message.getGroup(1, noQuoteEntriesGroup1); Please have a look at the server side program and advise me as to what = could be the problem and why am i receiving "Required tag missing:295". server side code : void Application::onMessage( const FIX44::MassQuote& message, const = FIX::SessionID& sessionID ) { std :: cout<< "MassQuote Msg received from client" << std::endl; FIX::QuoteID quoteID; FIX::NoQuoteSets noQuoteSets; =20 message.get( quoteID ); std :: cout<< " QuoteID=3D " << quoteID <<std::endl; message.get( noQuoteSets ); std :: cout<< " NoQuoteSets=3D " << noQuoteSets <<std::endl; FIX44::MassQuote::NoQuoteSets noQuoteSetsGroup; =20 FIX::QuoteSetID quoteSetID; FIX::TotNoQuoteEntries totNoQuoteEntries; FIX::NoQuoteEntries noQuoteEntries; message.getGroup(1, noQuoteSetsGroup); noQuoteSetsGroup.get( quoteSetID ); std :: cout<< " QuoteSetID=3D " << quoteSetID <<std::endl; if( noQuoteSetsGroup.isSet( totNoQuoteEntries ) ){ noQuoteSetsGroup.get( totNoQuoteEntries ); std :: cout<< " TotNoQuoteEntries=3D " << totNoQuoteEntries = <<std::endl; } if( noQuoteSetsGroup.isSet( noQuoteEntries ) ){ noQuoteSetsGroup.get( noQuoteEntries ); std :: cout<< " NoQuoteEntries=3D " << noQuoteEntries <<std::endl; } =20 FIX44::MassQuote::NoQuoteSets::NoQuoteEntries noQuoteEntriesGroup1; FIX::QuoteEntryID quoteEntryID; std :: cout<< " have defined noQuoteEntriesGroup1 " << std::endl; std :: cout<< " TotNoQuoteEntries=3D " << totNoQuoteEntries = <<std::endl; std :: cout<< " NoQuoteEntries=3D " << noQuoteEntries <<std::endl; message.getGroup(1, noQuoteEntriesGroup1); std :: cout<< " we have got noQuoteEntriesGroup1 " << std::endl; if( !noQuoteEntriesGroup1.isSet( quoteEntryID ) ) { =20 std :: cout<< " QuoteEntryID field not set" << std::endl; }=20 =20 if( noQuoteEntriesGroup1.isSet( quoteEntryID ) ){ noQuoteEntriesGroup1.get( quoteEntryID ); std :: cout<< " QuoteEntryID=3D " << quoteEntryID <<std::endl; std :: cout<< "have reached here" << std::endl; } FIX44::MassQuoteAcknowledgement massQuoteAcknowledgement =3D = FIX44::MassQuoteAcknowledgement ( FIX::QuoteStatus( 0 )); try { FIX::Session::sendToTarget( massQuoteAcknowledgement, sessionID ); } catch ( FIX::SessionNotFound& ) {} } =20 client side code : FIX44::MassQuote Application::queryMassQuote44() { FIX44::MassQuote massQuote(FIX::QuoteID( "IDq" ) ); FIX44::MassQuote::NoQuoteSets noQuoteSetsGroup; FIX::TotNoQuoteEntries totNoQuoteEntries; FIX::NoQuoteEntries noQuoteEntries; =20 noQuoteSetsGroup.set( FIX::QuoteSetID( "IDs" ) ); massQuote.addGroup( noQuoteSetsGroup ); =20 FIX44::MassQuote::NoQuoteSets::NoQuoteEntries noQuoteEntriesGroup1; noQuoteEntriesGroup.setField(FIX::QuoteEntryID( "IDe" ) ); noQuoteSetsGroup.addGroup( noQuoteEntriesGroup1 );=20 queryHeader( massQuote.getHeader() ); return massQuote; =20 } Regards=20 Joy=20 |