RE: [Quickfix-developers] CME XML Spec File
Brought to you by:
orenmnero
From: <em...@co...> - 2005-01-05 17:00:48
|
Jason, As you know CME requires tag 789 in the logout message. What I have done is modified the Session class of the QuickFix engine a little bit by adding a 'generateLogout' method that is a public member, as well as adding a 'logoff' method to the SocketInitiator and ThreadedSocketInitiator that is public and takes the SessionID as the parameter. So then I have the following: SocketInitiator extension void SocketInitiator::logoff(const SessionID& sessionID) { QF_STACK_PUSH(SocketInitiator::logoff) Session* pSession = Session::lookupSession(sessionID); if(pSession) pSession->generateLogout(-1); QF_STACK_POP } Session extension void Session::generateLogout( int error ) { QF_STACK_PUSH(Session::generateLogout) Message logout; logout.getHeader().setField( MsgType( MsgType_Logout ) ); int nNextSeqNum_ = getExpectedSenderNum(); IntField next_expected_sequence_number(789, nNextSeqNum_); logout.setField(next_expected_sequence_number); fill( logout.getHeader() ); sendRaw( logout ); m_state.sentLogout( true ); QF_STACK_POP } The reason I have done this is because all the sequence numbers are stored within the QuickFix engine module. It was done as a quick solution and there are probably much better ways of handling this. Actually just looking at it now, a much better way of doing this is by adding this tag in the 'toAdmin' method. You already probably have : Header& header_ = msg.getHeader(); eader_.setField(fix_sender_sub_id_); header_.setField(fix_sender_location_id_); header_.setField(fix_target_sub_id_); so just add the following: Session* pSession = Session::lookupSession(sessionID); ATLASSERT(pSession); //throw some kind of exception here if it is NULL, not gonna write code for that now int nNextSeqNum_ = pSession->getExpectedSenderNum(); IntField next_expected_sequence_number(789, nNextSeqNum_); msg.setField(next_expected_sequence_number); It should be ass simple as that although have not tried it this way. The reason I have extended the SocketInitator and Session classes is because I wanted to have the ability to call logoff when I wanted to. Generally, I would advise you to modify the message to cope with non-standard fields when you are actually constructing the message, as you are going to have a number of non-standard fields for CME in order submission, order pulling, etc. Hope that helps. Regards, Emir Kamber -----Original Message----- From: Jason Fagan [mailto:jf...@ty...] Sent: Wednesday, January 05, 2005 4:29 PM To: em...@co... Subject: RE: [Quickfix-developers] CME XML Spec File Emir, Is it possible I am using the wrong approach? When receiving a logout message QuickFIX rejected it because of the non-standard field 789 in the message. Where is the best place to modify the message to cope with non-standard fields, the fromAdmin callback or in the message definitions? Regards Jason _____ From: qui...@li... [mailto:qui...@li...] On Behalf Of em...@co... Sent: 05 January 2005 15:42 To: jf...@ty... Cc: qui...@li... Subject: RE: [Quickfix-developers] CME XML Spec File Jason, I have successfully developed to CME's iLink 2 but have not used a spec file for it. Why do you want to use an XML spec file when you already have all the definitions you need in the appropriate fix42 header files supplied. The application we developed is a stand-alone that connects to both the iLink gateway and the market-data feed from the MD boxes. Regards, Emir Kamber -----Original Message----- From: Jason Fagan [mailto:jf...@ty...] Sent: Wednesday, January 05, 2005 3:01 PM To: qui...@li... Subject: [Quickfix-developers] CME XML Spec File Hi, Would anyone happen to have a FIX spec file for CME's iLink 2 that they would be happy to share? Regards Jason Fagan --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004 |