EMA consumer handling of messages with StreamState ==OmmState.StreamState.CLOSED_REDIRECTED

How should an EMA consumer handle a MarketPrice Status message received with the state component publishing StreamState == OmmState.StreamState.CLOSED_REDIRECTED?


Could you please provide a RIC that results in 'StreamState.CLOSED_REDIRECTED' for testing purposes.

Best Answer

  • @xinjames.chen

    Thank you for reaching out to us.

    The OmmState.StreamState.CLOSED_REDIRECTED is quite rare. It indicates that the current stream is closed and has new identifying information. The user can issue a new request for the data using the new message key data from the redirect message.

    However, the data feed may or may not use this feature.

    The easiest way to replicate this message is using a Provider application. You can modify the IProvider100 example to publish this message. The code looks like this:

        event.getProvider().submit(StatusMsg()
            .domainType(MMT_MARKET_PRICE)
            .state(OmmState::ClosedRedirectedEnum, OmmState::SuspectEnum, OmmState::NoneEnum, "Rename")
            .name("NEW_RIC.BK")
            .nameType(INSTRUMENT_NAME_RIC),
            event.getHandle());

    Then, the consumer will get this message.

    StatusMsg
        streamId="5"
        domain="MarketPrice Domain"
        state="Redirected / Suspect / None / 'Rename'"
        name="NEW_RIC.BK"
        nameType="1"
        serviceName="DIRECT_FEED"
    StatusMsgEnd

    After that, the consumer needs to call the registerClient method to subscribe to this new item.