Re: [Quickfix-developers] Java Application::fromApp provides Message with lost groups
Brought to you by:
orenmnero
From: Gene G. <mus...@ya...> - 2002-12-06 03:12:56
|
Make sure that the QuickFIX configuration file specifies correct path to a Data Dictionary XML for your session. On Unix the path specification has to be relative to the FIX process working directory, (unless another of our patches has made it to the release that you are using) We have an QuickFIX Java application that successfully receives group News messages running on Linux, as long as the Data Dictionary is found. Gene --- gar...@su... wrote: <HR> <P>Can you confirm that this issue was fixed? I rebuilt everything from the tagged checkout for solaris w/ STL and I am not seeing any groups come across on a fromApp call. I looked at the Conversions.h that got checked 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 the JNI layer and I still am not seeing the groups come across.</P><P>Can you verify that groups come across now in the java version? Is there 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-3118 (W)<BR>445 Hamilton Avenue 914-422-3693 (F)<BR>White Plains, NY 10601 <BR><BR>Please visit us at <A HREF=http://www.cpmarket.com>http://www.cpmarket.com</A> </P><P> <BR><FONT SIZE=2><B>OM...@th...</B></FONT><BR><FONT SIZE=2>Sent by: qui...@li...</FONT><BR><FONT SIZE=2>11/19/2002 02:02 PM CST</FONT><BR><BR> <FONT SIZE=2>To:</FONT> <FONT SIZE=2>mus...@ya..., qui...@li...</FONT><BR> <FONT SIZE=2>cc:</FONT> <FONT SIZE=2>se...@mi...</FONT><BR> <FONT SIZE=2>bcc:</FONT> <BR> <FONT SIZE=2>Subject:</FONT> <FONT SIZE=2>Re: [Quickfix-developers] Java Application::fromApp provides Message with lost groups</FONT><BR> <BR><BR></P><P><FONT FACE="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="Monospace,Courier">You are right in noting that the design for groups is not perfect. It<BR>wasn't until support for groups was added that a DataDictionary all of the<BR>sudden was required in order to parse a message, so there are definately a<BR>few issues that have bled over.<BR></FONT><BR><FONT FACE="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 better<BR>idea than just using the configuration file because I see use for the<BR>message class as a standalone class.<BR></FONT><BR><FONT FACE="Monospace,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 out the data<BR>dictionary for that session if available. If the session does not exist<BR>and no data dictionary is passed in, it will use the default 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 custom begin strings. Thoughts?<BR></FONT><BR><FONT FACE="Monospace,Courier">--oren<BR></FONT><BR><BR><BR><FONT FACE="Monospace,Courier">|---------+-----------------------------------------------><BR>| | Gene Gorokhovsky |<BR>| | <mus...@ya...> |<BR>| | Sent by: |<BR>| | qui...@li...ur|<BR>| | ceforge.net |<BR>| | |<BR>| | |<BR>| | 11/19/2002 11:10 AM |<BR>| | |<BR>|---------+-----------------------------------------------><BR> >----------------------------------------------------------------------------------------------|<BR> | |<BR> | To: OM...@th..., qui...@li... |<BR> | cc: se...@mi... |<BR> | Subject: [Quickfix-developers] Java Application::fromApp provides Message with lost |<BR> | groups |<BR> >----------------------------------------------------------------------------------------------|<BR></FONT><BR><BR><BR><BR><FONT FACE="Monospace,Courier">Sergey Gribov and myself discovered the following<BR>problem (QuickFIX 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 invalid, by the time it reaches<BR>Java Application fromApp and fromAdmin callbacks.<BR></FONT><BR><FONT FACE="Monospace,Courier">We traced the problem to JNI layer. Here is the patch<BR>for src/java/Conversions.h (tested on Linux/gcc 3.2.1)<BR></FONT><BR><FONT FACE="Monospace,Courier">124c124<BR>< pMessage->setString( message.toString() );<BR>---<BR>> *pMessage = message;<BR>141c141<BR>< pMessage->setString( message.toString() );<BR>---<BR>> *pMessage = message;<BR></FONT><BR><FONT FACE="Monospace,Courier">------------------------------------------<BR>While the above patch fixes the immediate problem at<BR>hand, this does expose a design issue: setString does<BR>not work correctly for messages with repeating groups<BR>if DataDictionary is not supplied. The resulting<BR>message has a corrupted structure (group count field<BR>has correct count, the rest of group field are present<BR>only once). Athough setString returns false<BR>(constructor using it even throws), I think that this<BR>method with DataDictinary not supplied is dangerous<BR>and should be hidden from the public interface<BR>altogether, or at the very least it should throw an<BR>exception.<BR></FONT><BR><FONT FACE="Monospace,Courier">The upshot is that the message cannot be safely<BR>restored from a string without somehow externally<BR>knowing the DataDictionary needed for that, despite<BR>source string containing the protocol version (which<BR>cannot be extracted without constructing Message...)<BR></FONT><BR><FONT FACE="Monospace,Courier">I think that there could be a collection of<BR>DataDictionaries 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=./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 generate 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 override, and Message class will pick up the<BR>correct spec themselves using BeginString, instead of<BR>always relying on the DataDictionary parameter.<BR></FONT><BR><FONT FACE="Monospace,Courier">Custom tags will requite a custom 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></FONT><BR><FONT FACE="Monospace,Courier">Changes are also required for non-validating 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 be an explicit setting in the<BR>config file, with meaningful exceptions thrown when a<BR>message with repeating tags is received.<BR></FONT><BR><FONT FACE="Monospace,Courier">Gene<BR></FONT><BR><FONT FACE="Monospace,Courier">__________________________________________________<BR>Do you Yahoo!?<BR>Yahoo! Web Hosting - Let the expert host your site<BR><A HREF=http://webhosting.yahoo.com>http://webhosting.yahoo.com</A><BR></FONT><BR><BR><FONT FACE="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=http://www.gothawte.com/rd524.html>http://www.gothawte.com/rd524.html</A><BR>_______________________________________________<BR>Quickfix-developers mailing list<BR>Qui...@li...<BR><A HREF=https://lists.sourceforge.net/lists/listinfo/quickfix-developers>https://lists.sourceforge.net/lists/listinfo/quickfix-developers</A><BR></FONT><BR><BR><BR><BR><BR><BR><BR><FONT FACE="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=http://www.gothawte.com/rd524.html>http://www.gothawte.com/rd524.html</A><BR>_______________________________________________<BR>Quickfix-developers mailing list<BR>Qui...@li...<BR><A HREF=https://lists.sourceforge.net/lists/listinfo/quickfix-developers>https://lists.sourceforge.net/lists/listinfo/quickfix-developers</A></FONT></P> ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |