Hello,
Is the auto failover mechanism wont work with multiple credential if connection failure happens in OmmConsumer constructor? Here is my env and repeat steps:
RTSDK: 2.2.3.E1
Lang: C++
OS: Redhat 7
In my env, we have 2 servers which can be logon with 2 different usernames. Let say
Server_A: username = User_A
Server_B: username = User_B
The <ChannelSet> in EmaConfig.xml is set to "Server_A, Server_B".
My application start with the following code snippet to create OmmConsumer:
class AppLoginClient : public OmmLoginCredentialConsumerClient
{
void onLoginCredentialRenewal(const OmmConsumerEvent& consumerEvent)
{
// Update login name to "User_B"
LoginMsgCredentialRenewal credentialRenewal;
credentialRenewal.userName( EmaString( "User_B") );
consumer->renewLoginCredentials( credentialRenewal );
}
};
……
AppLoginClient loginClient; // Inherit OmmLoginCredentialConsumerClient
Login::LoginReq* login = new Login::LoginReq;
login->name( EmaString("User_A") );
OmmConsumerConfig cfg ( EmaString( "./EmaConfig.xml") );
cfg.addLoginMsgCredential( login->getMessage(), EmaString( "Server_A, Server_B") , loginClient, (void*)login );
OmmConsumer consumer( cfg );
In the above code, I expect to receive onLoginCredentialRenewal callback to update login name on any connection issue happened in Server_A.
However, if connection to Server_A failed in the OmmConsumer constructor, RealtimeSDK will connect to Server_B automatically but login with "User_A", and the onLoginCredentialRenewal() is not called.
Checked the logic in OmmBaseImpl::loginCredentialCallback() in OmmBaseImpl.cpp,
onLoginCredentialRenewal() will only be called if pBaseImpl->isInitialized() is true.
Could you please advice how application can change the username when constructing OmmConsumer?
Thanks