Auto failover does not work with multi credential if connection failed when constructing OmmConsumer
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
Best Answers
-
Thank you for reaching out to us.
I checked with the Con480 example in the package, by using the following parameters.
-LoginMsg name:user1 channelList:Channel_1 -LoginMsg name:user2 channelList:Channel_2
The example works properly. It uses the user1 to connect o Channel_1 and uses the user2 to connect to Channel_2 although the Channel_1 failed at startup.
Please test it with the Con480 example.
To confirm the behavior in the OmmConsumer's constructor, please contact the API support team directly via Contact Premium Support. Otherwise, you can raise this issue on GitHub.
1 -
Yes, it is an expected behavior. When the username is invalid, the server will close the login stream. API will not perform connection recovery when the login stream is closed.
0
Answers
-
Hello @Jirapongse
Thanks for your quick reply. Tested with Con480 and multi credential works.
One more question, will EMA perform failover if server is up but login fail?
I tested with an invalid username on Channel_1 and a valid username on Channel_2. OmmConsumer constructor throws "OmmInvalidUsageException" without trying to connect to Channel_2. Is this expected?Thanks
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛