Hi @Chaitanya.Vishnubhotla
Please refer to the EMA ConfigGuide.pdf for details of the various timeout parameters.
The LoginTimeoutRequest Parameter which is set at the Consumer config level will allow you to control how long EMA waits for a Login Response.
<Consumer> <!-- Name is mandatory --> <Name value="Consumer_1"/> <!-- Channel is optional: defaulted to "RSSL_SOCKET + localhost + 14002"--> <!-- Channel or ChannelSet may be specified--> <Channel value="Channel_1"/> <!-- Dictionary is optional: defaulted to "ChannelDictionary"--> <Dictionary value="Dictionary_1"/> <LoginRequestTimeOut value="5000"/></Consumer>
So, above I have specified 5 seconds timeout.
Also, please refer to the following post on how to capture Invalid Login scenario:
How to interpret Login messages for invalid user for Java EMA api
In com.thomsonreuters.ema.examples.training.consumer.series100.example130__MarketPrice__UserDisp - consumer.java classwe have a line consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().operationModel(OperationModel.USER_DISPATCH).host("10.72.78.42:14002").username("721001")); which gives an exception when either server and host or userid is wrong after 45 seconds. Can the error response can be made faster i.e., not to wait for 45 seconds as our code tries to connect for four servers which comes nearly to 3 minutes.
Also, is there any way to API throws a specific error like Userid submitted is not a valid one.
Hi
Thanks for your reply. I was able to reduce the timeout. But I am still not able to get any string like User id is not valid when I am trying to print the statusmsg.state()
Have you implemented the Login handler code from example330__Login__Streaming as mentioned in the other post I linked above?
What exactly do you see in the StatusMsg ?
Hi @Umer Nalla,
Nothing is getting printed in the method onstatusmsg()Kindly, please let me know how to get the line
State: State: Closed/Suspect/User unknown to permissioning system, it could be DACS, AAA or EED - text: "721001, unknown to system
programmatically.
I just tried the steps from the linked post and I got the following output to the console from the OnStatusMsg handler:
Received Status. Item Handle: 1 Closure: nullItem Name: userService Name: <not set>Item State: Closed / Suspect / User unknown to permissioning system, it could be DACS, AAA or EED / 'user, unknown to system.'
Are you sure you are following all the steps mentioned in the above post - specifically the following post by Wasin Waeosri?
Could you please re-test the scenario with EMA Java 1.1.0 (Elektron SDK 3.1.0) which is the latest version? This version has fixed the "Consumer application does not receive denied login message/event" issue. You can use the EMA Java example330__Login__Streaming to verify the issue.
If you study the example code for example 330 you will notice that it specifies the ConsumerClient instance appClient to receive callbacks when creating the OmmConsumer
consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("10.13.234.56:14002").username("user"), appClient);
As you may know, the login is performed behind the scenes by EMA when the above line of code is executed - i.e. EMA tries to connect to the server 10.13.234.56 on port 14002 using the DACS id of 'user'. Specifying appClient as the callback client results in the response from the Login being passed onto appClient included the any StatusMsg for a failed Login or a RefreshMsg for a Successful Login.
I am getting the below compilation error when I downloaded the latest version EMA1.1
The method createOmmConsumer(OmmConsumerConfig, OmmConsumerErrorClient) in the type EmaFactory is not applicable for the arguments (OmmConsumerConfig, AppClient) Consumer.java
Do I need to update any of my jars, please let me know
Each release of the API usually comes with its own set of jars. Please use the correct jars.
Certainly in this case, the error message suggests a mismatch in parameters between the example code & the method definition and as pointed out earlier there was a bug fix, so latest versions of the jars would be the 1st thing to try.