Hello, we found that there was disconnection when we used EMA to get dynamic data. The error report is as follows. What's the problem? thank you
һÔÂ 21, 2021 12:02:57 ÉÏÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback
¾¯¸æ: loggerMsg
ClientName: ChannelCallbackClient
Severity: Warning
Text: Received Channel warning event on channel Channel_1
Instance Name Consumer_1_2
RsslReactor @50e3bf38
RsslChannel @5af32797
Error Id 0
Internal sysError 0
Error Location Reactor.processWorkerEvent
Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"}
loggerMsgEnd
һÔÂ 20, 2021 11:04:30 ÏÂÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback
¾¯¸æ: loggerMsg
ClientName: ChannelCallbackClient
Severity: Warning
Text: Received ChannelDownReconnecting event on channel Channel_1
RsslReactor @5ea7d158
RsslChannel @10f6165f
Error Id 0
Internal sysError 0
Error Location Reactor.processWorkerEvent
Error text Ping error for channel: Lost contact with connection...
loggerMsgEnd
һÔÂ 20, 2021 11:04:30 ÏÂÎç com.refinitiv.ema.access.LoginCallbackClient rdmLoginMsgCallback
¾¯¸æ: loggerMsg
ClientName: LoginCallbackClient
Severity: Warning
Text: RDMLogin stream state was changed to suspect with status message
username <not set>
usernameType <not set>
State: Open/Suspect/None - text: ""
loggerMsgEnd
2021-01-20 23:04:31,848 Timer-0 [monitorLogger(36)]-[INFO] | Monitor2021-01-20 23:04:31[]
һÔÂ 20, 2021 11:04:36 ÏÂÎç com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback
ÐÅϢ: loggerMsg
ClientName: ChannelCallbackClient
Severity: Info
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_2
Component Version ads3.4.2.L1.linux.tis.rrg 64-bit
loggerMsgEnd
һÔÂ 20, 2021 11:04:36 ÏÂÎç com.refinitiv.ema.access.LoginCallbackClient rdmLoginMsgCallback
ÑÏÖØ: loggerMsg
ClientName: LoginCallbackClient
Severity: Error
Text: RDMLogin stream was closed with status message
username xxxxxxxxxxxxx
usernameType 1
State: Closed/Suspect/Internal error from sender - text: "Login Denied:Failed to validate sso token"
loggerMsgEnd
Hello @zzuwhj @Xiaorong.Xu
The "Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"} " error message indicates that the API cannot gets OAuth grant credentials from the RDP Auth service server.
How often the application occurs? Did the issue occur when the application tries to connect to the server for the "first time" or after it runs for a while?
I can't replicate the issue with the latest version of RTSDK 2.0/EMA Java 3.6.0 in my environment. I have run the ex450_MP_QueryServiceDiscovery example for a while and the API can run and get tokens successfully.
Could you please enable the API log to turn on the HTTP REST messages between the API and the server? You can enable it by setting the logging.properties file (the file is available at <RTSDK-2.0.0.L1 package>\Java\Ema\Core\src\main\resources folder) with the following pattern
.level=FINEST handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=FINEST java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.FileHandler.level=FINEST java.util.logging.FileHandler.pattern=<absolute path to your log file location>//ema.log java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s %2$s %n%5$s
Then run the application with the JVM argument -Djava.util.logging.config.file points to the logging.properties file
Example:
-Djava.util.logging.config.file=C:\drive_d\Project\APIs\EMA_Code\EMA_Java_200_Maven\src\main\resources\logging.properties
Please note that you can set the following properties on logging.properties file for the log file roll-over:
Hello @zzuwhj
The "Error text Failed REST request for the token service from HTTP status code 400 for user: xxxxx. Text: {"error":"invalid_grant"} " error message seems to relate to the API couldn't get the Authentication. I am assuming that you are connecting to the Refinitiv Real-Time Optimized (ERT in Cloud) connection?
@wasin.waeosri Thank you for your answer. Next, what aspects of analysis and troubleshooting do we need
Hi Wasin
Thank you for your help. After discussing with client, I would confirm the error message popped out when client api is ready for receiving dynamic messages, e.g. updates. The method was consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON_DD").payload(elementList), dynamicDataCallback);
With regard to replicating with EMA ex450_MP_QueryServiceDiscovery. I am working with client.
In the meantime could you please advise the cause and how to avoid it? Thank you.
Thank you for your reply
The issue occur when the application tries to connect to the server after it runs for a while.
we use the ex450_MP_QueryServiceDiscovery example:
ElementList batch = EmaFactory.createElementList();OmmArray array = EmaFactory.createOmmArray();
// subscribe all
int num = stocksSize;
Iterator<String> codeIterator = USDataCenter.getInstance().getRicCodes();
while (codeIterator.hasNext()) {
try {
array.add(EmaFactory.createOmmArrayEntry().ascii(codeIterator.next()));
num--;
if (num % 1000 == 0) {
batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));
cloudClient.getDyncStock(batch);
array.clear();
batch.clear();
}
} catch (Exception e) {
}
}
we enable the API log but can't find log file。
Hello @zzuwhj
Could you please share your logging.properties file and your -Djava.util.logging.config.file command?
The authentication to api.refinitiv.com (for RDP Auth service) is for the Login stream only, not item streams. Basically, the authentication flow is the following:
The API REST log file will let us check whether the "error":"invalid_grant" error message is returned from which Token request message.
Additonally, you may contact The Refinitiv Real-Time Optimized team to verify this RDP response error message via my.refinitiv.com website. Please choose "Refinitiv Real-Time - Optimize" Product and you may need to provide your Machine ID detail.
Dear Waeosri, thank you for your help. Could you please specify how client can find or generate the files you asked earlier?
Thank you
Hello @Xiaorong.Xu
The client can find the example logging.properties file from the following locations:
Please note that the logging.properties is the Java Logging API configuration file. The client can find more detail about the configuration file from Oracle or any Java resources.
thx
We want to know more
Are we using a consumer client to subscribe to multiple US stock markets at the same time?
Or can multiple consumerclients be used for subscription?
thank you!
Hello @zzuwhj
Sorry for the late reply. Yes, you can use a single consumer client to consume multiple items from various markets. You can use the API Batch feature to send multiple items in a single request message, please see more detail on the EMA Java Example ex370_MP_Batch in the SDK package.
Please note that the Machine-ID supports 5 concurrent connections.