Re: [Quickfix-developers] Java Application::fromApp provides Message with lost groups
Brought to you by:
orenmnero
From: <gar...@su...> - 2002-12-06 02:32:01
|
<P>Can you confirm that this issue was fixed? I rebuilt everything fr= om the tagged checkout for solaris w/ STL and I am not seeing any groups co= me across on a fromApp call. I looked at the Conversions.h that got c= hecked out and it didn't have the changes specified below (it still had the= toString calls). So I made the changes described below and rebuilt t= he JNI layer and I still am not seeing the groups come across.</P><P>Can yo= u verify that groups come across now in the java version? Is t= here any sure way I can tell if I've got the right source?</P><P> </P>= <P>Thanks,</P><P> </P><P>Gary Mui<BR>Prescient Markets, Inc 914-989-31= 18 (W)<BR>445 Hamilton Avenue 914-422-3693 (F)<BR>White Plains, NY 10601 <B= R><BR>Please visit us at <A HREF=3Dhttp://www.cpmarket.com>http://www.cpmar= ket.com</A> </P><P> <BR><FONT SIZE=3D2><B>OM...@th...</B>= </FONT><BR><FONT SIZE=3D2>Sent by: qui...@li...urcefo= rge.net</FONT><BR><FONT SIZE=3D2>11/19/2002 02:02 PM CST</FONT><BR><BR> <FO= NT SIZE=3D2>To:</FONT> <FONT SIZE=3D2>mus...@ya..., quickfix-develope= rs...@li...</FONT><BR> <FONT SIZE=3D2>cc:</FONT> <FONT SIZE=3D= 2>se...@mi...</FONT><BR> <FONT SIZE=3D2>bcc:</FONT> <BR> <FONT SIZE= =3D2>Subject:</FONT> <FONT SIZE=3D2>Re: [Quickfix-developers] Java Applicat= ion::fromApp provides Message with lost groups</FONT><BR> <BR><BR></P><P><F= ONT FACE=3D"Monospace,Courier">Good catch guys. That is a good patch.= Anyone using groups in java should<BR>apply it, I'll also add it to = the repository.<BR></FONT><BR><FONT FACE=3D"Monospace,Courier">You are righ= t in noting that the design for groups is not perfect. It<BR>wasn't u= ntil support for groups was added that a DataDictionary all of the<BR>sudde= n was required in order to parse a message, so there are definately a<BR>fe= w issues that have bled over.<BR></FONT><BR><FONT FACE=3D"Monospace,Courier= ">I think that having the default data dictionaries embedded into the code<= BR>for use by the message is probably a good idea. I think it is a be= tter<BR>idea than just using the configuration file because I see use for t= he<BR>message class as a standalone class.<BR></FONT><BR><FONT FACE=3D"Mono= space,Courier">When there are sessions available, I think it would be good = to have<BR>setString pick out the SessionID, do a lookupSession, and pull o= ut the data<BR>dictionary for that session if available. If the sessi= on does not exist<BR>and no data dictionary is passed in, it will use the d= efault based on the<BR>beginstring. If a data dictionary is passed in= , it will be used no matter<BR>what. This should avoid the need for c= ustom begin strings. Thoughts?<BR></FONT><BR><FONT FACE=3D"Monospace,= Courier">--oren<BR></FONT><BR><BR><BR><FONT FACE=3D"Monospace,Courier">|---= ------+-----------------------------------------------><BR>| &nbs= p; | Gene Gorokhovsky &nbs= p; |<BR>| &nb= sp; | <musor102@= yahoo.com> |<BR>|= | Sent by: =  = ; |<BR>| | &n= bsp; qui...@li...ur|<BR>| = | ceforge.net &nbs= p; |<= BR>| |  = ; &nb= sp; |<BR>| &= nbsp; | &nbs= p; &n= bsp; |<BR>| |  = ; 11/19/2002 11:10 AM &nbs= p; |<BR>| | =  = ; |<BR>|----= -----+-----------------------------------------------><BR> >---= ---------------------------------------------------------------------------= ----------------|<BR> | &nb= sp; &= nbsp; = &nbs= p; |<BR> | &nb= sp; To: OM...@th..., quickf= ix-...@li... |<BR>= | cc: se...@mi... &= nbsp; = &nbs= p; |<BR> | &n= bsp; Subject: [Quickfix-developers] Java Application::fromApp = provides Message with lost |<BR> | = groups  = ; &nb= sp; &= nbsp; |<BR> &g= t;-------------------------------------------------------------------------= ---------------------|<BR></FONT><BR><BR><BR><BR><FONT FACE=3D"Monospace,Co= urier">Sergey Gribov and myself discovered the following<BR>problem (QuickF= IX 1.3.2):<BR>When receiving a message with Group fields, the<BR>message is= corrupted -- group information is lost,<BR>and message length is inv= alid, by the time it reaches<BR>Java Application fromApp and fromAdmin call= backs.<BR></FONT><BR><FONT FACE=3D"Monospace,Courier">We traced the problem= to JNI layer. Here is the patch<BR>for src/java/Conversions.h (tested on L= inux/gcc 3.2.1)<BR></FONT><BR><FONT FACE=3D"Monospace,Courier">124c124<BR>&= lt; pMessage->setString( message.toString() );<BR>---<BR>> &nb= sp; *pMessage =3D message;<BR>141c141<BR>< pMessage->setString= ( message.toString() );<BR>---<BR>> *pMessage =3D message;<BR></F= ONT><BR><FONT FACE=3D"Monospace,Courier">----------------------------------= --------<BR>While the above patch fixes the immediate problem at<BR>hand, t= his does expose a design issue: setString does<BR>not work correctly for me= ssages with repeating groups<BR>if DataDictionary is not supplied. The resu= lting<BR>message has a corrupted structure (group count field<BR>has correc= t count, the rest of group field are present<BR>only once). Athough setStri= ng returns false<BR>(constructor using it even throws), I think that this<B= R>method with DataDictinary not supplied is dangerous<BR>and should be hidd= en from the public interface<BR>altogether, or at the very least it should = throw an<BR>exception.<BR></FONT><BR><FONT FACE=3D"Monospace,Courier">The u= pshot is that the message cannot be safely<BR>restored from a string withou= t somehow externally<BR>knowing the DataDictionary needed for that, despite= <BR>source string containing the protocol version (which<BR>cannot be extra= cted without constructing Message...)<BR></FONT><BR><FONT FACE=3D"Monospace= ,Courier">I think that there could be a collection of<BR>DataDictiona= ries available to Message internally based<BR>on the protocol's BeginString= value.<BR>They could be loaded based on entries in the Default<BR>Section = of the CFG file<BR>DataDictionary.FIX41=3D./FIX41.xml, or perhaps their<BR>= content should be even be hard-coded as the strings in<BR>one of the header= files, since providing a data-dict<BR>XML different from the one used to g= enerate code may<BR>not be such a hot idea. That way sessions will refer<BR= >to the version of the protocol, with XML spec being an<BR>optional overrid= e, and Message class will pick up the<BR>correct spec themselves using Begi= nString, instead of<BR>always relying on the DataDictionary parameter.<BR><= /FONT><BR><FONT FACE=3D"Monospace,Courier">Custom tags will requite a custo= m XML spec associated<BR>with a custom FIX beginstring, or recompilation of= <BR>quickfix code, which I do not see as much of a<BR>problem, since = this is already required for type-safe<BR>usage of the custom tags.<BR></FO= NT><BR><FONT FACE=3D"Monospace,Courier">Changes are also required for non-v= alidating mode,<BR>since this mode is currently broken for reception of<BR>= messages with repeating groups -- Java fromApp is<BR>silently never called,= and C++ fromApp gets a<BR>corrupted message.<BR>Perhaps this mode should b= e an explicit setting in the<BR>config file, with meaningful exceptions thr= own when a<BR>message with repeating tags is received.<BR></FONT><BR><FONT = FACE=3D"Monospace,Courier">Gene<BR></FONT><BR><FONT FACE=3D"Monospace,Couri= er">=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F<BR>Do you Yahoo!?<BR>Yahoo! Web Hosting - Let the expert host your s= ite<BR><A HREF=3Dhttp://webhosting.yahoo.com>http://webhosting.yahoo.com</A= ><BR></FONT><BR><BR><FONT FACE=3D"Monospace,Courier">----------------------= ---------------------------------<BR>This sf.net email is sponsored by: To = learn the basics of securing<BR>your web site with SSL, click here to get a= FREE TRIAL of a Thawte<BR>Server Certificate: <A HREF=3Dhttp://www.gothawt= e.com/rd524.html>http://www.gothawte.com/rd524.html</A><BR>=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<BR>Quickfix-developers = mailing list<BR>Qui...@li...<BR><A HREF=3Dhttp= s://lists.sourceforge.net/lists/listinfo/quickfix-developers>https://lists.= sourceforge.net/lists/listinfo/quickfix-developers</A><BR></FONT><BR><BR><B= R><BR><BR><BR><BR><FONT FACE=3D"Monospace,Courier">------------------------= -------------------------------<BR>This sf.net email is sponsored by: To le= arn the basics of securing<BR>your web site with SSL, click here to get a F= REE TRIAL of a Thawte<BR>Server Certificate: <A HREF=3Dhttp://www.gothawte.= com/rd524.html>http://www.gothawte.com/rd524.html</A><BR>=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<BR>Quickfix-developers mai= ling list<BR>Qui...@li...<BR><A HREF=3Dhttps:/= /lists.sourceforge.net/lists/listinfo/quickfix-developers>https://lists.sou= rceforge.net/lists/listinfo/quickfix-developers</A></FONT></P>= |