Market Price pause for individual items

thimalk
thimalk Explorer

How can we pause individual market price requests, is there specific example for this. (I found example 350 for pause all open items.

Best Answer

  • To send pause for an individual item, application needs to call reissue for item handle instead of login handle.

    Please see the following example code. The code has been modified on the example 350 to send pause for <JPY=> RIC, once the application receives 10 updates for the RIC.

    void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
    {
    ...
    // pause all items when 10th update is received
    if ( updateMsg.getDomainType() == MMT_MARKET_PRICE && updateMsg.getName()=="JPY=")
    {
    if ( ++_updateNumber == 10 )
    {
    cout << endl << "Pause item stream" << endl;
    //_pOmmConsumer->reissue( ReqMsg().domainType( MMT_LOGIN ).initialImage( false ).pause( true ).name( "user" ), _loginHandle );
    _pOmmConsumer->reissue( ReqMsg().domainType( MMT_MARKET_PRICE ).initialImage( false ).pause( true ).name( "JPY=" ), ommEvent.getHandle() );
    }
    }
    }

Answers