send data to adh with python

Hi - I would like to send some data to an internal source using python - do you have any examples of how to bring up a source app and send data please?

Ideally my python script would advertise a port, which the adh would connect to and then i send the data directly to the adh.

Thanks

Martin

Tagged:

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @martin.gregory

    Please be informed that we have only a plan for the SDK C# edition only, you can find more detail from the RTSDK roadmap page (note: the items and date information are subject to change).

    You can submit an enhancement request to the product team about the Python SDK via the https://my.refinitiv.com/content/mytr/en/feedback.html page.

    Additionally, can you clarify this "it means I need another source app to host the source to accept the SSL inserts I think?" message?

    The ADS' WebSocket connection supports the Post/Contribution feature. The consumer-source application can connect to the ADS via the WebSocket connection, then contribute data directly to the ADS via the Post message (in JSON message format) as the following diagram. The ADS automatics convert the Post JSON message to Refinitiv Real-Time format and post that data to the ADH server.

    websocket-posting.png

    The ADH server can be configured a "cache-service" for receiving and caching the Post data without the source application via the cacheServiceList parameter:

    cacheservicelist.png

    You can find more detail about the ADH and Posting message configurations in section 13 "OMM Posting and SSL Inserts" of the ADH document.


Answers

  • Hello @martin.gregory

    Do you mean you want the Python script that runs as an Interactive Provider/Non-Interactive Provider, then the ADH connects to that script and receives data from the Python source app?

    If so, the Interactive Provider and Non-Interactive Provider features are available with Refinitiv Real-Time SDK (EMA and ETA APIs) Java and C/C++ editions only. You can find more detail about the EMA API Non-Interactive Provider in the following resources:

    Alternatively, You can use the Real-Time WebSocket API to "contribute" data from a Python application to ADH via the following connection diagram:

    Python --> ADS --> ADH

    You can find more detail about contributing data with the WebSocket API from the following resources:

    Hope this helps.


  • Hi Wasin - thanks for the information. Are there any plans to make the SDK available for python?

    Because if we go down the ADS---->ADH route, it means I need another source app to host the source to accept the SSL inserts i think?

    Thanks

    Martin



  • hi @martin.gregory ,

    It can be done using Websocket API, I'd like to recommend you to check the tutorials and articles below and please let us know in case you have any further questions

  • Hi @martin.gregory

    In addition to my colleagues' responses above, you may also find the following article useful.

    Testing Real-time Streaming applications with Docker & Refinitiv Real-Time Connector Part 2 | Refinitiv Developers

    Whilst it talks about RTC, the same principles apply to an ADH - see the section 'Configure RTC for a Posting Cache and NIProvider service'

    The service that is created in the above steps allows for Posting and/or Non-interactive provider to populate its cache.

  • Thanks very much. So just so im clear the solution at present would be to bring up a non interactive source on the adh and define it in the cacheServiceList and then use an ads connection via the websocket connection to insert into it?

    Thanks

    Martin

  • Hello @martin.gregory

    Yes, you understand correctly.

    Please note that you must also enable the ADH to support Posting/Inserting. I highly recommend you contact your Market Data team to help you with the ADH configurations.

  • Hi all


    I'm getting an error message on "ID" when posting into the ADS via the websocket - see below. Please can you help me where I'm going wrong?

    Thanks

    Martin


    SENT:

    {

    "Ack":true,

    "Domain":"MarketPrice",

    "ID":"777",

    "Key":{

    "Name":"MARTIN",

    "Service":"LFC2"

    },

    "Message":{

    "Domain":"MarketPrice",

    "Fields":{

    "ASK":2,

    "BID":1

    },

    "ID":"777",

    "Key":{

    "Name":"MARTIN",

    "Service":"LFC2"

    },

    "Type":"Update"

    },

    "PostID":1,

    "PostUserInfo":{

    "Address":"10.200.211.211",

    "UserID":"radmin"

    },

    "Type":"Post"

    }

    [{"ID":0,"Type":"Error","Text":"JSON Converter Token Type error: Expected 'PRIMITIVE' for

    key 'ID' Received 'STRING'","Debug":{"File":"/local/jenkins/workspace/RTDS35XCore_Release/OS/OL7-64/esdk/source/rtsdk/Cpp-C/Eta/Impl/Converter/jsonToRwfSimple.C","Line":364,"Offset":335,"Message":"{\"Domain\": \"MarketPrice\", \"Ack\": true, \"PostID\": 1, \"PostUserInfo\": {\"Address\": \"10.200.211.211\", \"UserID\": \"radmin\"}, \"Key\": {\"Name\": \"MARTIN\", \"Service\": \"LFC2\"}, \"Message\": {\"ID\": \"777\", \"Type\": \"Update\", \"Domain\": \"MarketPrice\", \"Fields\": {\"BID\": 1, \"ASK\": 2}, \"Key\": {\"Name\": \"MARTIN\", \"Service\": \"LFC2\"}}, \"Type\": \"Post\", \"ID\": \"777\"}"}}]

  • Pls ignore - have fixed this
  • Hello @martin.gregory

    I am glad to hear that the issue has been fixed on your side.

    According to the Real-Time WebSocket API specification, the ID value needs to be an integer, not a string.

    post-msg.png

    You can find more detail about the WebSocket API protocol, and JSON message structure from the following resources:


  • Thanks all to all 3 (this reply and the ones below, and above). I'm connected to an ads websocket now and sending off stream json posts successfully. The links raksina sent were particularly useful in this regard.
  • Very useful links, thank you.