question

Upvotes
Accepted
1 0 0 1

"basicConsumer" "login" "options" help! Python ok. market_price_rdpgw_client_cred_auth.py retrieves prices well.

Am having trouble figuring out how to run basicConsumer examples in the EMAJ tutorial. Unlike python. With the python client market_price_rdpgw_client_cred_auth.py I can retrieve prices:

python3 ./M_market_price_rdpgw_client_cred_auth.py --clientid 12-34-56 --clientsecret 1234-5678 --hostname us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net

results in

2024-02-27 15:36:32.287728 Refinitiv Data Platform Authentication succeeded. RECEIVED:
{
"access_token":"xtsacPx8p51EezA7SIk43TSIJ3ke",
"expires_in":7199,
"token_type":"Bearer"
}
2024-02-27 15:36:32.288714 Session1: Connecting WebSocket to wss://us-east-1-aws-3-med.optimized-pricing-api.refinitiv.net:443/WebSocket...
2024-02-27 15:36:32.307977 Session1: WebSocket successfully connected!
2024-02-27 15:36:32.308124 SENT on Session1:

...


"Key":{
"Elements":{
"AllowSuspectData":1,
"ApplicationId":"256",
"ApplicationName":"RTO",
"AuthenticationErrorCode":0,


... and prices for my requested rics:


{
"DoNotConflate":true,
"Fields":{
"TRADE_DATE":"2024-02-27",
"TRDPRC_1":18016.5,
"TRDVOL_1":2
},
"ID":5,
"Key":{
"Name":"NQH24",
"Service":"ELEKTRON_DD"
},
"SeqNumber":43646,
"Type":"Update",
"UpdateType":"Trade"
}

However, when I try anything with the basicConsumer which I managed to properly build and get to run yesterday I get missing parameters. According to Refinitiv Devportal I should be calling runConsumer like so: https://developers.lseg.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java/tutorials#ema-consumer-requesting-and-displaying-market-price-data

./runConsumer.ksh 2 -username 12-34-56 -password 1234-5678 -clientId 256 -location us-east -service ELEKTRON_DD -itemName NQH24

Running tutorial 2...

Missing required parameters.

Options (Connecting into Real-Time -- Optimized):
-username Machine ID to perform authorization with the token service. Required. [null]
-password Password to perform authorization with the token service. Required. [null]
-clientId Client ID, or Appkey. Required. [null]
-location Location to get an endpoint from RDP service discovery. Default: [us-east]
-service Name of service providing market data. Default: [ELEKTRON_DD]
-itemName Request item name. Default: [IBM.N]

Options (Connecting into a deployed RTDS):
-host Hostname or IP address and port of the deployed server (Eg: ads:14002). Required. [null]
-username Username to connect into the deployed streaming server. [null]
-service Name of service providing market data. Default: [ELEKTRON_DD]
-itemName Request item name. Default: [IBM.N]

Processing complete

According to the Tutorials webportal the command should be run like this, with ID being the clientId corresponging to the app_id, which I assumed from the successful python script's output.

> runConsumer 2 -username XX-Y-01234567-1-1234 -password <passwd> -clientId <appkey>

Any help would be greatly appreciated.

Thanks

JT









elektron-sdk#technologyjavarefinitiv-realtime-sdktutorial
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.

@JTSV

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
22.1k 59 14 21

Hi @JTSV,

We are migrating from a V1 authentication system which uses OAuth Password Grant (username, password and clientID) to a V2 system - which uses OAuth Client Credentials (clientID, clientSecret). Due to this some of the tutorials are still pending update.

You have a V2 account, and the sample you are trying to run only uses V1 login options. I would recommend that you use the EMA Example 450 Service Discovery which comes with the EMA SDK, while we update the old tutorials. This example can be run with both V1 and V2 options - so be sure to use clientID and clientSecret command line options here.

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.

Hello Gurpreet,


Thank you! I will take a look.

Off the top of your head, is there an example to pull in prices which I can combine with Example 450 to create a Franken-client that will pull in baskets/views, recover from dropped connections, the works?

I took some notes about modifications I made to the basicConsumer classpath to get it humming. I could share them if you like. I've seen there's an email to send them to. It might help others.

You and I were on a call with Frank on Friday at 15:00 GMT (10:00 your time?), by the way. Thank you for your suggestion to move to the SDKs.

Thanks,

Joaquin




Hi Joaquin, I remember the call now.

Ex450 will get you quite a way there - with login, endpoint service discovery, and subscribing to a single instrument. The connection recovery is automatic and part of the EMA SDK - the client application will get status messages regarding connection down/up etc.

Adding a batch and view is not a lot of code after that.


PS: I realized that Ex 451 is even better (simpler) example of use of client credentials.

Upvote
22.1k 59 14 21

Additional details -

While the examples listed earlier show how to do things programmatically, this all can be simplified by moving configuration into the EMAConfig.xml file and using a simple Ex113 MP Session Management and strip out all the configuration code as well.

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.

Upvotes
1 0 0 1

Thank you Gurpreet! All of this will greatly help. Jumping into it now.

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.

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.