Error going from desktop.workspace to platform.deployed

Hello,


I am using the Refinitiv Data Api. I have no issue running the following script on my machine (when Eikon Desktop is running)

import refinitiv.data as rd

rd.open_session('desktop.workspace')

rd.get_data(

universe=['USDSROISTNZ=R'],

fields=['PRIMACT_1']

)

I get a dataframe of the data that I am looking for, so all good.


When I try to run the following

rd.open_session('platform.deployed')

rd.get_data(

universe=['USDSROISTNZ=R'],

fields=['PRIMACT_1']

)

the code gets stuck and it does not give me any output or error, simply gets stuck (probably in an endless loop).


This is are the components of the refinitiv-data.config.json file. I am using the same app key (It's an Eikon Data API key). Url and Dacs are coming from the market data team in my company

"desktop": {

"workspace": {

"app-key": "#### APP KEY ####"

}

}


"deployed": {

"app-key": "#### APP KEY ####",

"realtime-distribution-system": {

"url" : " xxx.xx.xxx.x:xxxxx",

"dacs" : {

"username" : "xxxxxx",

"application-id" : xxx,

"position" : ""

}

}

}




Any idea what is happening?

Best Answer

  • umer.nalla
    Answer ✓

    Hi @lucio.fiorin

    I notice a space in your URL

    ws:// xxx.xx.xxx.x:15000/WebSocket

    If there is a space in your json file, please try removing it

    ws://xxx.xx.xxx.x:15000/WebSocket

Answers

  • Hi @lucio.fiorin,

    The 'platform.deployed' specification refers to sessions that connect directly to your own deployed streaming service. The 'deployed' configuration does not require an 'app-key'. If you are attempting to connect to your own deployed streaming service and want to get prices, you will need to utilize the pricing interfaces:

    Example.DataLibrary.Python/Examples/1-Access/EX-1.01.03-PricingStream.ipynb at main · Refinitiv-API-Samples/Example.DataLibrary.Python · GitHub

    Example.DataLibrary.Python/Examples/2-Content/2.02-Pricing/EX-2.02.03-Pricing-StreamingCache.ipynb at main · Refinitiv-API-Samples/Example.DataLibrary.Python · GitHub

  • Hi,

    Agree, the space was causing problems. Now it is able to connect.

    I am trying the following code as suggested:

    stream = rd.open_pricing_stream(

    universe=['USDSROISTNZ=R'],

    fields=['PRIMACT_1'],

    on_data=display_data

    )


    but I get the following error(s)


    [2023-06-22T17:22:42.786412+01:00] - [sessions.platform.deployed.0] - [DEBUG] - [36172 - ThreadOMMSTREAMING_PRICING_0.0] - [stream_connection] - [_on_message] - [OMMSTREAMING_PRICING_0.0] on_ws_message [{"ID": 5, "Type": "Status", "Key": {"Name": "USDSROISTNZ=R"}, "State": {"Stream": "Closed", "Data": "Suspect", "Code": "AlreadyOpen", "Text": "Request Rejected: Request key did not contain service Id."}}]


  • Hi @lucio.fiorin

    As your organisation's real-time servers probably have more than one service being published (and no default specified), you will need to specify the service you wish to consume data from


    stream = rd.open_pricing_stream(
    universe=['GBP=', 'EUR=', 'JPY='],
    fields=['BID', 'ASK'],
     service='ELEKTRON_DD',
    on_data=display_data
    )

    Please check with your Market Data team that ELEKTRON_DD is indeed the correct service name to use.


  • @lucio.fiorin

    Also, check your dacs id also does not have a leading space...

  • Hello,

    I am using the exact same specification suggested by the market data team, not sure how they can get a result running the same script then.

    I was able to add the logs, I get the following error (I redacted the realtime distribution system url


    [2023-06-22T16:53:55.979009+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] try to reconnect over url ws:// xxx.xx.xxx.x:15000/WebSocket
    [2023-06-22T16:53:55.980009+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] wait start connecting
    [2023-06-22T16:53:55.980009+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] is connecting
    [2023-06-22T16:53:55.982009+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] connect
        num_attempt : 3
        url : ws:// xx.xx.xxx.x:15000/WebSocket
        headers : ['User-Agent: Python']
        cookies : None
        transport : websocket
        subprotocols: ['tr_json2']
    [2023-06-22T16:53:55.983012+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] on_ws_error: Exception: [Errno 11001] getaddrinfo failed
    [2023-06-22T16:53:55.983012+01:00] - [DEBUG] - [sessions.platform.deployed.0] - [7636] | ThreadOMMSTREAMING_PRICING_0.0
    [OMMSTREAMING_PRICING_0.0] on_ws_close: close_status_code=None, close_msg=None, state=StreamCxnState.Connecting




  • Hi @lucio.fiorin

    Can you confirm there is no space in your actual IP? Appears to be there again:

    url         : ws:// xx.xx.xxx.x:15000/WebSocket