Thread: [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 |
From: Oren M. <or...@qu...> - 2004-08-18 17:53:48
|
Joy, I think you're client code should look more like this. It looks=20 like in your version you are adding an empty noQuoteEntriesGroup. =20 Also, you are adding the noQuoteEntriesGroup1 to your noQuoteSetsGroup=20= after having already added it to the massQuote. This means the group=20 will never make it into the actual message. FIX44::MassQuote Application::queryMassQuote44() { FIX44::MassQuote massQuote(FIX::QuoteID( "IDq" ) ); FIX44::MassQuote::NoQuoteSets noQuoteSetsGroup; FIX::TotNoQuoteEntries totNoQuoteEntries; FIX::NoQuoteEntries noQuoteEntries; noQuoteSetsGroup.set( FIX::QuoteSetID( "IDs" ) ); FIX44::MassQuote::NoQuoteSets::NoQuoteEntries noQuoteEntriesGroup1; noQuoteEntriesGroup.setField(FIX::QuoteEntryID( "IDe" ) ); noQuoteSetsGroup.addGroup( noQuoteEntriesGroup1 ); massQuote.addGroup( noQuoteSetsGroup1 ); queryHeader( massQuote.getHeader() ); return massQuote; } As for which number fields to set, you never need to set the field the=20= group is named after. So when you create a=20 FIX44::MassQuote::NoQuoteSets, you know that you don't have to set the=20= NoQuoteSets field. TotNoQuoteEntries is not one of those, so you must=20= set it yourself. --oren On Aug 18, 2004, at 8:10 AM, Joy Bannerjee wrote: > i am still having problem using inner (nested) groups. Here is a=20 > detailed discription of what i am doing. I am using quickfix-1.8.0=A0=20= > and FIX 44 version on windows platform. I have written the client and=20= > the server in c++. I am having problem handling MassQuote message=20 > since it has a group (NoQuoteEntries) nested within another group=20 > (NoQuoteSets). > I have the following questions: > =A0 > 1.=A0 Does the user enter values for fields like TotNoQuoteEntries and=20= > NoQuoteEntries? > =A0=A0=A0=A0=A0If not, =A0then on the client side are these fields to = be set with=20 > empty objects of TotNoQuoteEntries=A0and=A0=A0NoQuoteEntries? OR Are = these=20 > fields=A0not to be set at all? > =A0=A0=A0=A0 How does one handle these two fiels on the client side? = And=A0how=20 > does QuickFix generate values for these fields? > =A0=A0=A0 =A0It seems in my case "NoQuoteSets" is having no problem in=20= > generating the proper value even without the need to set it on the=20 > client side but but the same does not seem to be happening in case of=20= > TotNoQuoteEntries and NoQuoteEntries (i.e it does not get any value=20 > unless it is set on the client side ). Please have a look at the code=20= > provided below. > <snip> > =A0 > FIX44::MassQuote Application::queryMassQuote44() > { > =A0 > =A0 FIX44::MassQuote massQuote(FIX::QuoteID( "IDq" ) ); > =A0 FIX44::MassQuote::NoQuoteSets noQuoteSetsGroup; > =A0 > =A0 FIX::TotNoQuoteEntries totNoQuoteEntries; > =A0 FIX::NoQuoteEntries noQuoteEntries; > =A0 > =A0 noQuoteSetsGroup.set( FIX::QuoteSetID( "IDs" ) ); > =A0 massQuote.addGroup( noQuoteSetsGroup ); > =A0 > =A0 FIX44::MassQuote::NoQuoteSets::NoQuoteEntries = noQuoteEntriesGroup1; > =A0 noQuoteEntriesGroup.setField(FIX::QuoteEntryID( "IDe" ) ); > =A0 noQuoteSetsGroup.addGroup( noQuoteEntriesGroup1 ); > =A0 > =A0 queryHeader( massQuote.getHeader() ); > =A0 return massQuote; > =A0=A0 > } > Regards > Joy=A0 > =A0 > =A0 > =A0 > =A0 > =A0 > =A0 > =A0 > =A0 > =A0 |