[Quickfix-developers] Unexpected feature of Message.toString()
Brought to you by:
orenmnero
From: Timothy Y. <Tim...@pa...> - 2004-09-16 17:51:18
|
I have a quickfix application that effectively operates purely at the session level. It uses quickfix to read FIX messages from a FIX session then converts each message to a string and sticks it on a JMS queue. The application revealed an interesting feature of quickfix repeating group support. If you parse a message containing a repeating group then call toString() on the message the result is not a correctly ordered message. (This is because quickfix contructs a Group object internally that has 'default' field ordering.) I noticed this problem because the upstream component that extracts the message from the JMS queue is probably too pedantic and insists on correct group ordering. Here's a test program that demonstrates the problem. (I am using quickfix 1.7.0, but I don't think anything has been changed in the latest version). ----------------- #include <Message.h> #include <DataDictionary.h> using namespace FIX; using namespace std; int main(int argc, char* argv[]) { try { DataDictionary dd("FIX43.xml"); string msgStr("8=FIX.4.3\0019=199\00135=E\00134=126\00149=BUYSIDE\00150=00303\00152 =20040916-16:19:18.328\00156=SELLSIDE\00166=1095350459\00168=2\00173=2\00111 =1095350459\00167=1\0011=00303\00155=fred\00154=1\00140=1\00159=3\00111=1095 350460\00167=2\0011=00303\00155=fred\00154=1\00140=1\00159=3\001394=3\00110= 138\001"); Message m(msgStr, dd); cout << m.toString() << endl; } catch (InvalidMessage& e) { cout << "Invalid message:" << e.what() << endl; } catch (...) { cout << "An exception occurred" << endl; } return 0; } ---------------- Here's the program output: 8=FIX.4.3?9=199?35=E?34=126?49=BUYSIDE?50=00303?52=20040916-16:19:18.328?56= SELL SIDE?66=1095350459?68=2?73=2?11=1095350459?1=00303?40=1?54=1?55=fred?59=3?67 =1?1 1=1095350460?1=00303?40=1?54=1?55=fred?59=3?67=2?394=3?10=138? Tim Yates Lead Developer Patsystems (US) LLC 141 West Jackson Boulevard Chicago 60604, USA Tel +1 (312) 542-1336 www.patsystems.com |