|
From: Toli K. <to...@ma...> - 2007-04-27 17:59:31
|
Naresh, I think the HEAD version of QFJ actually supports what you want. Check out QFJ-154 (http://www.quickfixj.org/jira/browse/QFJ-154) The MessageFactory interface has the following function: public Group create(String beginString, String msgType, int correspondingFieldID); This may not be exactly what you want, but it helps to do this in a fix-version-agnostic way. If you have a DataDictionary, you can get the beginString with dataDictionary.getVersion() To answer your question about field order in Group - I don't think it matters what order you have the fields in the group, as long as you construct the Group correctly. I just put together a quick unit test with fields out of order in a group, and it validates just fine. Once you have your message generated from a broker-specific DataDictionary, you can use dictionary.validate(message, true) to validate the message prior to sending it out (or you can do it in the tests at least). The HEAD version of QFJ has a new validate() function that only validates the body, specifically for this purpose. so if this helps. try using the code from HEAD, it's stable. On 4/27/07, Naresh Bhatia <NB...@sa...> wrote: > > I need some advice from this group about dynamic (vs. compile-time) message > handling. I am in a situation where we are building a system that will talk > to approximately 300 brokers. The brokers support varying levels of FIX and > many of them have defined custom fields and groups. Supporting all these > variations in code with type-safe APIs is going to be a nightmare, so I am > willing to sacrifice compile-time safety in favor of dynamic message > handling. I have started externalizing all message configuration in data > dictionaries - one per broker (of course, these are based on one of 5 > FIX4x.xml files provided with quickfix). Does this approach make sense? > > So far I am doing pretty ok with message creation as well as parsing using > the data dictionary, except with repeating groups. My hope was that I could > create a Group definition right from the data dictionary, but the best it > can do right now is to give me GroupInfo, thus loosing the field order. Am I > missing something? > > I also checked out the MessageFactory api, but as I understand it, it > returns one of the generated Message or Group classes and does not use the > data dictionary. Please correct me if I am wrong. > > Thanks for your help. > > Naresh -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |