Search code examples
c++quickfix

QuickFix c++ Unsupported message type


Im developing a bot in c++ using QuickFix, using Remarkets to test my app but my quickfix engine is rejecting almost all messages when I crack them.

Message recieved:

8=FIXT.1.1|9=116|35=h|34=3|49=ROFX|52=20201026-17:11:49.665|56=user|325=Y|335=NONE|336=[N/A]|340=2|1300=DDA|1301=ROFX|10=228|

Message sent from me (client) to server:

8=FIXT.1.1|9=118|35=j|34=4|49=user|52=20201026-17:11:52.374|56=ROFX|45=3|58=Unsupported Message Type|372=h|380=3|1137=9|10=168|

Application.h

...
  void onMessage( const FIX50::TradingSessionStatus& M, const FIX::SessionID& S)
throw(  FIX::FieldNotFound,
        FIX::IncorrectDataFormat,
        FIX::IncorrectTagValue,
        FIX::UnsupportedMessageType );

...

Application.cpp:

void Application::fromApp(const FIX::Message& message,
                          const FIX::SessionID& sessionID )
throw(FIX::FieldNotFound,
      FIX::IncorrectDataFormat,
      FIX::IncorrectTagValue,
      FIX::UnsupportedMessageType)
 {

  crack( message, sessionID );

 }


void Application::onMessage
( const FIX50::TradingSessionStatus& M, const FIX::SessionID& S) 
throw(  FIX::FieldNotFound,
        FIX::IncorrectDataFormat,
        FIX::IncorrectTagValue,
        FIX::UnsupportedMessageType )
    
{
    
std::cout << "MENSAJE H";
    
}        

FIXT11.xml:

 <value enum='h' description='TRADING_SESSION_STATUS'/>

FIX50SP2.xml:

  <message name='TradingSessionStatus' msgtype='h' msgcat='app'>
   <component name='ApplicationSequenceControl' required='N' />
   <field name='TradSesReqID' required='N' />
   <field name='MarketID' required='N' />
   <field name='MarketSegmentID' required='N' />
   <field name='TradingSessionID' required='Y' />
   <field name='TradingSessionSubID' required='N' />
   <field name='TradSesMethod' required='N' />
   <field name='TradSesMode' required='N' />
   <field name='UnsolicitedIndicator' required='N' />
   <field name='TradSesStatus' required='Y' />
   <field name='TradSesEvent' required='N' />
   <field name='TradSesStatusRejReason' required='N' />
   <field name='TradSesStartTime' required='N' />
   <field name='TradSesOpenTime' required='N' />
   <field name='TradSesPreCloseTime' required='N' />
   <field name='TradSesCloseTime' required='N' />
   <field name='TradSesEndTime' required='N' />
   <field name='TotalVolumeTraded' required='N' />
   <field name='Text' required='N' />
   <field name='EncodedTextLen' required='N' />
   <field name='EncodedText' required='N' />
   <component name='Instrument' required='N' />
  </message>

Config file:

UseDataDictionary=Y

Am I overriding "onMessage" correctly? What could be the reason for this rejection?

I've found this post with a similar problem, he solved it by updating quickfix. Im using version 1.15.1 downloaded from official website.


Solution

  • Thanks to Christoph John!!

    I was overriding onMessage for FIX50, i needed to override it for FIX50SP2.

    Original:

    void onMessage( const FIX50::TradingSessionStatus& M, const FIX::SessionID& S)
    throw(  FIX::FieldNotFound,
            FIX::IncorrectDataFormat,
            FIX::IncorrectTagValue,
            FIX::UnsupportedMessageType );
    

    Modified, working:

    void onMessage( const FIX50SP2::TradingSessionStatus& M, const FIX::SessionID& S)
    throw(  FIX::FieldNotFound,
                FIX::IncorrectDataFormat,
                FIX::IncorrectTagValue,
                FIX::UnsupportedMessageType );