|
From: Toli K. <to...@ma...> - 2007-03-29 19:32:19
|
Stacy, > 1 - If I use Message Cracker when receiving a message, does that mean that I > must define ALL the fields that might be in the FIX message I'm receiving? > Or only the ones I care about. I looked at the documentation and the section > called 'receiving messages' and I'm still not clear on this. You can only override the methods you are interested in. Look at the Ordermatch example, it's only dealing with incoming NewOrderSingle messages: http://quickfixj.svn.sourceforge.net/viewvc/quickfixj/trunk/examples/src/main/java/quickfix/examples/ordermatch/Application.java?revision=464&view=markup I'm not sure i understand your question. What do you mean by "define all fields that may be in FIX message"? You only "subscribe" to the kinds of messages you want (by overriding the right onMessage functions) and deal with them, extracting whatever fields you want. > 2-For testing purposes is there a way to read a FIX message defined in the > code or a text file? You can use the Message(String text) constructor to create a message from an existing string (so you can iterate over your file): Here's an example of it in our code: http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/spring/JMSFIXMessageConverter.java#L58 and an example in the test code in QFJ (line 85): http://quickfixj.svn.sourceforge.net/viewvc/quickfixj/trunk/core/src/test/java/quickfix/MessageTest.java?revision=601&view=markup You can also take a look at our OrderLoader code that reads orders from a file and sends them to our OMS: http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/orderloader/src/main/java/org/marketcetera/orderloader/OrderLoader.java and if you want to try it out (sorry, this is a plug) you can just download the entire Marketcetera platform and mess with our code directly, it may be a better way to get started by looking at examples: http://trac.marketcetera.org -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |