Simulate Force Logout From DACs StatusMsg

Hi,

Regarding the question i asked in a separate thread regarding "Force Logout from DACs" in https://community.developers.refinitiv.com/questions/108445/force-logout-from-dacs-with-warmstandbymode-servic.html.


I need to simulate Force Logout from DACs, in a test provider application to verity my application responds it as expected.

I submit market price updates in a loop, time to time i send force logout messages as below. But it doesn't work as expected.

I am expecting this message to receive, but i am not getting it in my application logs. Can you please correct whatever i am doing wrong ? I am using ema3.6.6.L1. My application crashed recently whenever i was receiving same message (i've mentioned it in https://community.developers.refinitiv.com/questions/109592/application-crash-at-logincallbackclientprocesssta.html)

}FtGroupId [100] SessionId [1] IsActiveSession [TRUE]{Output: Timestamp: 20230922-23:35:54.894551 StatusMsg
streamId="1"
domain="Login Domain"
state="Closed / Suspect / Not entitled / 'Force Logout from DACS.'"
name="AQIC5wM2LY4SfcyP9WdYMradVfbwJqNtsyiNU11bfGHX0eU%3D%40AAJTSQACMTAAAlNLABM1NzM1NDYxNDM0NTE5Mjk5NzgzAAJTMQACMjc%3D%23"
nameType="1"
StatusMsgEnd
}


for (SubscriptionInfo subscriptionInfo : appClient.m_userSubscriptionInfo)
{
std::cout << "Force logout user for handle: " << subscriptionInfo.handle << std::endl;
subscriptionInfo.providerEvent->getProvider().submit( StatusMsg()
.domainType(subscriptionInfo.domainType)
.name(subscriptionInfo.name.c_str())
.nameType(1)
.state(OmmState::ClosedEnum, OmmState::SuspectEnum, OmmState::DacsDownEnum, "Force Logout from DACS."),
subscriptionInfo.providerEvent->getHandle() );
}

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @thilinaillangasinghe

    Thank you for reaching out to us.

    You need to store the handle of the login stream and then use it to send the login close message.

    1. Store the login handle

    void AppClient::processLoginRequest( const ReqMsg& reqMsg, const OmmProviderEvent& event )
    {
        event.getProvider().submit(RefreshMsg().domainType(MMT_LOGIN).name(reqMsg.getName()).nameType(USER_NAME).complete().
            attrib( ElementList().complete() ).solicited( true ).state( OmmState::OpenEnum, OmmState::OkEnum, OmmState::NoneEnum, "Login accepted" ) ,
            event.getHandle() );
        loginHandle = event.getHandle();
    }

    2. Then, use it to send the login close message

            provider.submit(StatusMsg()
                .domainType(MMT_LOGIN)
                .state(OmmState::ClosedEnum, OmmState::SuspectEnum, OmmState::NotAuthorizedEnum, "Force Logout from DACS."), 
                appClient.loginHandle);

    You need to send just one login close message.

    You can enable tracing on the consumer side to verify the retrieved message.

    <Consumer>
    ...           
    <XmlTraceToStdout value="1"/>
    </Consumer>

    The message will look like this:

    <statusMsg domainType="RSSL_DMT_LOGIN" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x20 (RSSL_STMF_HAS_STATE)" dataState="RSSL_DATA_SUSPECT" streamState="RSSL_STREAM_CLOSED" code="RSSL_SC_NOT_ENTITLED" text="Force Logout from DACS."  dataSize="0">
        <dataBody>
        </dataBody>
    </statusMsg>


Answers