How to configure endpoint in LSEG Python library?

Hi community!

I am trying to find more information about how best to configure the lseg data library for Python. I am interested in connecting to an AWS endpoint that is closest to my servers. How can I configure this?

I am familiar with service discovery, but I cannot seem to find a way to change the configuration of the session.

Is it recommended to dynamically use service discovery API to get the host to connect to, or is it ok to configure it by hand?

Regards,

Bart

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Hello @bartwozniak

    You can configure the AWS connection region in the config file, under the entry apis/streaming/endpoint/main/location. Here for example, I have set it to US-EAST as a preferred region:

      {
      "sessions": {
        "default": "platform.one",
        "platform": {
        .
        .
        .
      },
       "apis": {
        "streaming": {
          "pricing": {
            "endpoints": {
              "main": {
                "locations": ["us-east"]
              }
            }
          }
        }
      }
    }
    

    It is recommended to use service discovery, since the list of connection endpoints can change, and also the returned list is specific to the user's account permissions.

  • Hi @Gurpreet

    This is very helpful, thank you. I am now able to select eu-west as my preferred location. How about selecting the service type? AFAIK there are live/live AZ1 or AZ2 or LSEG managed active/standby types. Can I specify what type I want to connect to in the configuration?

    Best,

    Bart

  • I don't think you can specify that as a part of configuration for LD library. If you have a need for that level of granularity in terms of resiliency and hot/warm standby, I would suggest that you either look into enterprise API like RTSDK which is available in Java, C++ and .NET, or use the Websockets API directly.

    Both these options will need much more coding on the part of the application, but allow a granular and complete control of the flow.

  • Thank you @Gurpreet

    Do you know if I can set one explicit endpoint to use instead of just the region? Let's say I want to configure my instance to connect to ap-southeast-1-aws-2-med.optimized-pricing-api.refinitiv.net is that possible in the LSEG Python lib?

  • Hi @bartwozniak

    Please check the WebSocket API - Python RTO examples if you need to see how the WebSocket API lets you specify the host.

    The WebSocket API is the core transport layer of the LSEG Data Library (streaming). You can check this https://developers.refinitiv.com/en/article-catalog/article/choosing-your-refinitiv-realtime-streaming-api article for more detail.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.