Re: [Quickfix-developers] Raw message data, one more question -- Ah forget it. I just need a break
Brought to you by:
orenmnero
From: Kenny S. <ks...@co...> - 2009-10-28 01:58:28
|
Seems like this constructor would be easier: SessionID( const std::string& beginString, const std::string& senderCompID, const std::string& targetCompID, const std::string& sessionQualifier = "" ) On Tue, Oct 27, 2009 at 7:47 PM, George Hrysanthopoulos < ge...@so...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Sorry everyone, > > I think I need to walk away from this computer. I am losing my mind. > > To answer my own question: > > SessionID is made up of fields: 8, 49 and 56 and it must look like: > "StringField8":"StringField49"->"StringField56". > > I can build it up: > > FIX::Message quickFixMessage; > std::string s; > > quickFixMessage.getHeader().setField(8, "FIX.4.2"); > quickFixMessage.getHeader().setField(49, "CLIENT1"); > quickFixMessage.getHeader().setField(56, "EXECUTOR"); > > // Now, from the message I can do: > s = quickFixMessage.getHeader().getField(8) + ":" \ > + quickFixMessage.getHeader().getField(49) + "->" \ > + quickFixMessage.getHeader().getField(56); > > // Get SessionID: > > sessionID.fromString(s); > > // Or if you prefer: > > try > { > sessionID = quickFixMessage.getSessionID(); > } > catch ( std::exception & e ) > { > myLogV(ALWAYS_PRINT, "\"fromApp\" Exception: %s\n", e.what()); > } > > Does Anyone here see a problem with this logic? > > -George > > > On Oct 27, 2009, at 8:17 PM, George Hrysanthopoulos wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Hello everyone, > > I think I almost got this problem solved. I just need one more piece to the > puzzle. > > In my previous msg I was working within: "Application::fromApp" > > Now, I am working within "Application::run()". > > I know that my "RawMessage" contains the SessionID. It should be field: 56. > My question is how do I create a session ID from a string? > > I can use the session ID to get the data dictionary. > > Once I have a data dictionary, I can validate the message: > "quickFixMessage = FIX::Message( RawMessage, dict )" > > As shown in my previous message. > > Thank you in advance. > > George Hrysanthopoulos > > On Oct 15, 2009, at 9:46 PM, Kenny Stone wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > You could also use the file store or logs that QuickFIX creates. > > On Thu, Oct 15, 2009 at 8:16 PM, George Hrysanthopoulos < > ge...@so...> wrote: > >> QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/index.html >> QuickFIX Support: http://www.quickfixengine.org/services.html >> >> Andrei, >> >> Thank you for the quick and very helpful reply. >> >> Just as you said, "QuickFIX::Message.toString()" did the trick. >> >> Here is my test code to get a string from a message and back again: >> >> >> 52 void Application::fromApp( const FIX::Message& message, const >> FIX::SessionID& sessionID ) >> 53 throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, >> FIX::IncorrectTagValue, FIX::UnsupportedMessageType ) >> 54 { >> 55 struct timeval tv; >> 56 struct timezone tz; >> 57 struct tm *tm; >> 58 std::string RawMessage; >> 59 std::string RawMessageXL; >> 60 >> 61 FIX::MsgType msgtype; >> 62 FIX::Message quickFixMessage; >> 63 >> 64 crack( message, sessionID ); >> 65 message.getHeader().getField( msgtype ); >> 66 >> 67 gettimeofday(&tv, &tz); >> 68 tm=localtime(&tv.tv_sec); >> 69 myLog(VERBOSE_L1, "Ticket Incoming: %d:%02d:%02d.%d\n", tm- >> >tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec); >> 70 >> 71 // >> 72 // >> 73 // Here is the "message" -> string -> "message" again >> 74 // >> 75 message.toString(RawMessage); >> 76 >> 77 myLogV(VERBOSE_L2, "MSG Type: %s\n", msgtype); >> 78 myLog(VERBOSE_L2, "Incoming Data:\n\t\t%s\n", >> RawMessage.c_str()); >> 79 // >> 80 // >> 81 // >> 82 FIX::Session* pSession = >> FIX::Session::lookupSession( sessionID ); >> 83 FIX::DataDictionary dict; >> 84 dict = pSession->getDataDictionary(); >> 85 try >> 86 { >> 87 quickFixMessage = FIX::Message( RawMessage, dict ); >> 88 } >> 89 catch ( std::exception & e ) >> 90 { >> 91 myLogV(ALWAYS_PRINT, "\"fromApp\" Exception: %s >> \n", e.what()); >> 92 } >> 93 myLogV(ALWAYS_PRINT, "\"XLData\":\n\t\t%s\n", >> quickFixMessage); >> ... >> ... >> >> >> You might as why bother? Well, with the outgoing messages in their >> original format (in a file) >> I can replay/resend a bunch of messages (in case of problems). >> >> Again, many thanks, >> >> George >> >> >> On Oct 15, 2009, at 3:02 PM, Andrei Goldchleger wrote: >> >> > QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/index.html >> > QuickFIX Support: http://www.quickfixengine.org/services.html >> > >> > On Thu, Oct 15, 2009 at 1:43 PM, George Hrysanthopoulos >> > <ge...@so...> wrote: >> >> QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/index.html >> >> QuickFIX Support: http://www.quickfixengine.org/services.html >> >> >> >> Hello everyone, >> >> >> >> Quick question: >> >> >> >> From my acceptor app, I want to get the raw data stream for a >> >> message >> >> (session or otherwise) >> >> including all field separators (0x01), etc. >> >> >> >> I want to dump this to a file later. >> >> >> >> How do I get this raw message? >> >> >> >> Many thanks, >> >> >> >> George Hrysanthopoulos >> > >> > Use the QuickFIX::Message.toString() in the fromApp() and fromAdmin() >> > callbacks. >> > >> > >> ------------------------------------------------------------------------------ >> > Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> > is the only developer event you need to attend this year. Jumpstart >> > your >> > developing skills, take BlackBerry mobile applications to market and >> > stay >> > ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> > http://p.sf.net/sfu/devconference >> > _______________________________________________ >> > Quickfix-developers mailing list >> > Qui...@li... >> > https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> >> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers >> > > > > -- > Kenny Stone > Connamara Systems, LLC > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference_______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference_______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > -- Kenny Stone Connamara Systems, LLC |