New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
26 1 4 14

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() );
}
#technology#productc++refinitiv-realtime-sdk
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
87.8k 294 53 79

@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>


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the response @Jirapongse .

I can see statusMsg received in XmlTrace file, but for some reason,

OmmConsumerClient::
onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& consumerEvent )

is not getting fired ? Note that

I can see it is getting fired for DomainType: 6,

e.g.

STDOUT"," ","DomainType: 6, StatusMsg: StreamState: 4, DataState: 2, StatusText: Login stream was closed.",



@thilinaillangasinghe

You may need to register to retrieve login events.

Please refer to the 330_Login_Streaming example in the package.

The 330_Login_Streaming showcases usage of login stream in OMM Consumer.
It demonstrates opening of login stream as well as its processing. Having
a login stream open is useful for consumer applications willing to do
Off Stream Posting and or knowing the state of its connectivity to server.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.