Ariticle

Introduction to the Real-Time WebSocket Docker Image

Author:

Jirapongse Phuriphanvichai
Developer Advocate Developer Advocate

Last Updated: June 2024

LSEG provides several methods for users to consume real-time streaming financial data from Real-time servers. Users can choose from low-level and high-performance APIs to high-level and easy-to-use WebSocket APIs. 

The Real-Time SDKs are suites of modern and open source APIs that are designed to simplify development through a strong focus on ease of use and standardized access to a broad set of proprietary content and services. They currently support C, C++, and Java programming languages and can be run on several operating systems including Windows, Oracle Linux, Red Hat Enterprise Linux, and CentOS.

Besides Real-Time SDKs, LSEG also provides a WebSocket solution for other developers who are not familiar with C, C++, and Java programming languages. The WebSocket API consists of a protocol specification and a set of sample programs used to illustrate the usage of the protocol to establish WebSocket connections to Real-Time Distribution Systems, or Real-Time - Optimized (cloud solution).

This article demonstrates how to use the Real-Time WebSocket API on the Docker platform. It has three sections including:

  • Real-Time APIs docker images on the Docker Hub
  • Deploying the Real-Time WebSocket API docker image
  • Running Python examples in the docker container 

Real-Time APIs docker images

The examples of Real-Time WebSocket API and the source code of the Real-Time SDKs are available on Github (C/C++, Java, and WebSocket API). Steps to build the Real-Time SDK libraries and run the examples are also mentioned on GitHub.

Fortunately, the Real-Time SDK Docker images are now available in Docker Hub, as shown below.

  • lsegrealtime/websocket_api: This docker image contains WebSocket API Examples used to connect to Real-Time Distribution System or Real-Time Optimized to consume real-time data through the WebSocket connections. There are examples of various programming languages such as CSharp, Java, Python, Go, Ruby, Node, Perl, and R. The image uses Oracle Linux 8 as a base image and it installs Python 3.9 used to run Python WebSocket API examples.
  • lsegrealtime/realtimesdk_c: This docker image contains the latest version of Real-Time SDK C/C++ libraries and examples. The image is rebuilt when the new version of Real-Time SDK is available in GitHub. It uses Oracle Linux 7 as a based image and the GCC version is 4.8.5.
  • lsegrealtime/realtimesdk_java: This docker image contains the latest version of Real-Time SDK Java libraries and examples. The image is rebuilt when the new version of Real-Time SDK is available in GitHub. It uses Oracle Linux 7 as a based image and the Oracle OpenJDK version is 11.

This article only focuses on the lsegrealtime/websocket_api docker image. This Docker image contains only the Python runtime and dependencies required to run the Python examples. If you need to run other examples in different programming languages, you need to manually install other compilers and dependencies. 

In the next section, I will demonstrate how to deploy the lsegrealtime/websocket_api image on Docker engines and Azure Containers.

Deploying the Real-Time WebSocket API docker image

The docker images can be run as docker containers on local machines or cloud platforms. To follow the steps in this section, the docker engine must be installed on a local machine or an Azure account is ready to be used.

Deploying the Real-Time WebSocket API docker image on a local machine

First, the docker engine must be installed and run properly on the machine. The "docker version" command can be used to verify the docker engine.

    	
            

PS C:\> docker version

Client:

 Cloud integration: v1.0.22

 Version:           20.10.12

 API version:       1.41

 Go version:        go1.16.12

 Git commit:        e91ed57

 Built:             Mon Dec 13 11:44:07 2021

 OS/Arch:           windows/amd64

 Context:           default

 Experimental:      true

Server: Docker Engine - Community

 Engine:

  Version:          20.10.12

  API version:      1.41 (minimum version 1.12)

  Go version:       go1.16.12

  Git commit:       459d0df

  Built:            Mon Dec 13 11:43:56 2021

  OS/Arch:          linux/amd64

  Experimental:     false

 containerd:

  Version:          1.4.12

  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d

 runc:

  Version:          1.0.2

  GitCommit:        v1.0.2-0-g52b36a2

 docker-init:

  Version:          0.19.0

  GitCommit:        de40ad0

When the docker engine is started, run the "docker pull lsegrealtime/websocket_api" command to pull the latest Real-Time WebSocket docker image from the Docker Hub.

    	
            

PS C:\> docker pull lsegrealtime/websocket_api

Using default tag: latest

latest: Pulling from lsegrealtime/websocket_api

671f9b4a2df1: Already exists

55f54a4c7507: Already exists

4f4fb700ef54: Already exists

Digest: sha256:23fababa66766f6c928408ccc8bdb1b2e85608bd43b1da32e38751ae7421ac0f

Status: Downloaded newer image for lsegrealtime/websocket_api:latest

docker.io/lsegrealtime/websocket_api:latest

Then, the "docker images" command can be used to verify that the Real-Time WebSocket API docker image is available on the machine.

    	
            

PS C:\> docker images

REPOSITORY                                  TAG            IMAGE ID       CREATED         SIZE

lsegrealtime/websocket_api                 latest         c9bd8bddaf15   4 days ago      541MB

The output of the "docker images" command must contain the lsegrealtime/websocket_api repository.

A Docker image can be run inside a container. The "docker run" command creates a new running container instance of the docker image. Run the following command to create a container instance of the Real-Time WebSocket API docker image.

    	
            

PS C:\> docker run -it --name websocket  lsegrealtime/websocket_api

sh-4.4# ls -al

total 112

drwxr-xr-x 2 root root  4096 Jun 11 08:11 .

drwxr-xr-x 6 root root  4096 Jun 11 08:11 ..

-rw-r--r-- 1 root root 14623 Jun 11 08:11 README.md

-rwxr-xr-x 1 root root 17895 Jun 11 08:11 market_price_rdpgw_authentication.py

-rwxr-xr-x 1 root root 19798 Jun 11 08:11 market_price_rdpgw_client_cred_auth.py

-rw-r--r-- 1 root root 21043 Jun 11 08:11 market_price_rdpgw_jwt_auth.py

-rwxr-xr-x 1 root root 24209 Jun 11 08:11 market_price_rdpgw_service_discovery.py

/opt/lseg/websocket-api/Applications/Examples/RDP/python

sh-4.4# pwd

/opt/lseg/websocket-api/Applications/Examples/RDP/python

sh-4.4#

After running this command, you can access a Linux shell in the container. Then, you can run the Real-Time WebSocket examples in the container. The default directory of the container is the /opt/lseg/websocket-api/Applications/Examples/RDP/python directory which contains Python examples to connect to Real-Time Optimized and you can find other examples in the /opt/lseg/websocket-api/Applications/Examples directory. 

Deploying the Real-Time WebSocket API docker image on Azure

Instead of running docker containers on the local machine, you can run the Real-Time WebSocket API docker container on Azure Container Instances. Azure Container Instances are used to create and manage Docker containers in Azure without having to set up virtual machines or manage additional infrastructure.

First, log in to Azure and then create a new Container Instances resource.

On the Create container instance page, fill in all required information. Select Docker Hub or other registry for the Image source and enter lsegrealtime/websocket_api for the Image. Then, click on the Next: Networking button.

On the Networking tab, keep the default setting. Then click on the Next: Advanced button.

On the Advanced tab, enter [ "/bin/bash", "-c", "echo hello; sleep 60m" ] for the Command override. This command will keep the container running for 60 minutes before exiting. You can use another command or change the sleep time to keep the container running. Then, click on Review + create button.

Next, review the information and then click on the Create button to create a container instance.

Wait for the deployment process to be completed.

After the deployment is complete, click on the created resource (websocketapi).

On the overview page, verify that the status of the container is Running.

Then, select Containers under Settings, click on the Connect tab, choose the shell to be used, and then click on the Connect button.

Now, you can access a bash shell in the container.

Running examples in the container

This section demonstrates how to run Python examples in the container to consume real-time data from Real-Time - Optimized. The Python examples are in the /opt/lseg/websocket-api/Applications/Examples/RDP/python directory.

To access Real-Time -- Optimized, you should have a v1 authentication (Machine ID) or v2 authentication (Service account). These authentication accounts are used to get tokens. Then the tokens can be used to login to Real-Time – Optimized. For more information regarding v1 and v2 authentication, please refer to the Account authorization V1 to V2 migration cheat sheet article.

The v1 authentication comprises of:

  • Machine ID: A username in the form of GE-A-XXXXXXXX-X-XXXX
  • Password: A password for the machine ID
  • Client ID: A client ID or App Key that can be generated by using the AppKey Generator

The v2 authentication comprises of:

  • Client ID: A public identifier for apps
  • Client Secret: A secret known only to the application and the authorization server

Note: The client_id in the v2 authentication is not the same value as the client_id in the v1 authentication which is an app key.

Please find more detail from the following resources about the v2 authentication.

Note: After June 2024, the V1 authentication is only available for Wealth users. RTO uses must migrate to the v2 authentication. 

The purpose of these examples is to connect to the Real-Time Optimized and retrieve JSON-formatted market content over a WebSocket connection.

These applications are intended as basic usage examples. Some of the design choices were made to favor simplicity and readability over performance. These applications are not intended to be used for measuring performance. The examples are available on GitHub.

Connecting to RTO with the V1 authentication

Running the market_price_rdpgw_service_discovery.py example

This example retrieves market-price content for a RIC after authenticating with an authentication server and uses tokens sent by that server to keep the connection alive. This example discovers the endpoint information using a service discovery URL using a region supplied as input. The content is retrieved using this endpoint information. This example maintains a session by proactively renewing the authentication token before expiration.

Run the example with the following parameters:

    	
            sh-4.4# python3 market_price_rdpgw_service_discovery.py  --user <UserID/MachineID> --password '<password>' --clientid <ClientID>
        
        
    

The output is:

    	
            

Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...

Refinitiv Data Platform Authentication succeeded. RECEIVED:

{

  "access_token":"eyJ0eXA...",

  "expires_in":"600",

  "refresh_token":"…",

  "scope":"trapi.streaming.pricing.read",

  "token_type":"Bearer"

}

Sending Refinitiv Data Platform service discovery request to https://api.refinitiv.com/streaming/pricing/v1/

Refinitiv Data Platform Service discovery succeeded. RECEIVED:

{

  "services":[

    {

      "dataFormat":[

        "tr_json2"

      ],

      "endpoint":"ap-southeast-1-aws-1-lrg.optimized-pricing-api.refinitiv.net",

      "location":[

        "ap-southeast-1a"

      ],

      "port":443,

      "provider":"aws",

      "transport":"websocket"

    },

    {

      "dataFormat":[

        "tr_json2"

      ],

      "endpoint":"ap-southeast-1-aws-3-lrg.optimized-pricing-api.refinitiv.net",

      "location":[

        "ap-southeast-1a",

        "ap-southeast-1b"

      ],

      "port":443,

      "provider":"aws",

      "transport":"websocket"

    },...

  ]

}

Connecting to WebSocket wss://us-east-1-aws-3-lrg.optimized-pricing-api.refinitiv.net:443/WebSocket for session1...

WebSocket successfully connected for session1!

SENT on session1:

{

  "Domain":"Login",

  "ID":1,

  "Key":{

    "Elements":{

      "ApplicationId":"256",

      "AuthenticationToken":"eyJ0e...",

      "Position":"172.17.0.2/e684c482a0d1"

    },

    "NameType":"AuthnToken"

  }

}

RECEIVED on session1:

[

  {

    "Domain":"Login",

    "Elements":{

      "MaxMsgSize":61426,

      "PingTimeout":30

    },

    "ID":1,

    "Key":{

      "Elements":{

        "AllowSuspectData":1,

        "ApplicationId":"256",

        "ApplicationName":"RTO",

        "AuthenticationErrorCode":0,

        "AuthenticationErrorText":{

          "Data":null,

          "Type":"AsciiString"

        },

        "AuthenticationTTReissue":1644472207,

        "Position":"172.17.0.2/e684c482a0d1",

        "ProvidePermissionExpressions":1,

        "ProvidePermissionProfile":0,

        "SingleOpen":1,

        "SupportBatchRequests":7,

        "SupportEnhancedSymbolList":1,

        "SupportOMMPost":1,

        "SupportOptimizedPauseResume":0,

        "SupportPauseResume":0,

        "SupportStandby":0,

        "SupportViewRequests":1

      },

      "Name":"..."

    },

    "State":{

      "Data":"Ok",

      "Stream":"Open",

      "Text":"Login accepted by host ads-fanout-lrg-az1-use1-prd."

    },

    "Type":"Refresh"

  }

]

SENT on session1:

{

  "ID":2,

  "Key":{

    "Name":"/TRI.N",

    "Service":"ELEKTRON_DD"

  }

}

RECEIVED on session1:

[

  {

    "Fields":{

      "52WK_HIGH":123.59,

      "52WK_LOW":80.16,

      "52W_HDAT":"2021-11-19",

      "52W_HIND":null,

      "52W_LDAT":"2021-02-22",

      "52W_LIND":null,

      "ACVOL_1":191271,

      "ACVOL_UNS":191271,

      "AC_TRN_CRS":null,

      "AC_VOL_CRS":0,

      "ADJUST_CLS":105.24,

      "AFTMKT_DT":null,

      "AFTMKT_NS":null,

      "AFTMKT_PRC":null,

      "AFTMKT_VOL":null,

      "ASK":0.0,

      "ASKSIZE":0,

      "ASK_1":105.24,

      "ASK_2":105.24,

      "ASK_COND_N":"R",

      "ASK_MMID1":null,

….

Running the market_price_rdpgw_authentication.py example

This example retrieves market-price content for a RIC after authenticating with an authentication server and uses tokens sent by that server to keep the connection alive. The content is retrieved using endpoint information (host and port) supplied as input. This example maintains a session by proactively renewing the authentication token before expiration.

Run the example with the following parameters:

    	
            sh-4.4# python3 market_price_rdpgw_ authentication.py  --user <UserID or MachineID> --password '<password>' --clientid <ClientID> --hostname <hostname>
        
        
    

The <hostname> could be ap-southeast-1-aws-1-lrg.optimized-pricing-api.refinitiv.net. You can find the Real-Time Optimized hostname lists from the Real-Time - Optimized New Hostnames August 2021 link or the RDP Service Discovery endpoint.

The output is:

    	
            

Sending authentication request with password to https://api.refinitiv.com:443/auth/oauth2/v1/token ...

Refinitiv Data Platform Authentication succeeded. RECEIVED:

{

  "access_token":"eyJ0eXA… ",

  "expires_in":"600",

  "refresh_token":"…",

  "scope":"trapi.streaming.pricing.read",

  "token_type":"Bearer"

}

Connecting to WebSocket wss://ap-southeast-1-aws-1-lrg.optimized-pricing-api.refinitiv.net:443/WebSocket ...

WebSocket successfully connected!

SENT:

{

  "Domain":"Login",

  "ID":1,

  "Key":{

    "Elements":{

      "ApplicationId":"256",

      "AuthenticationToken":"eyJ0eX…",

      "Position":"172.17.0.2/e684c482a0d1"

    },

    "NameType":"AuthnToken"

  }

}

RECEIVED:

[

  {

    "Domain":"Login",

    "Elements":{

      "MaxMsgSize":61426,

      "PingTimeout":30

    },

    "ID":1,

    "Key":{

      "Elements":{

        "AllowSuspectData":1,

        "ApplicationId":"256",

        "ApplicationName":"RTO",

        "AuthenticationErrorCode":0,

        "AuthenticationErrorText":{

          "Data":null,

          "Type":"AsciiString"

        },

        "AuthenticationTTReissue":1644472867,

        "Position":"172.17.0.2/e684c482a0d1",

        "ProvidePermissionExpressions":1,

        "ProvidePermissionProfile":0,

        "SingleOpen":1,

        "SupportBatchRequests":7,

        "SupportEnhancedSymbolList":1,

        "SupportOMMPost":1,

        "SupportOptimizedPauseResume":0,

        "SupportPauseResume":0,

        "SupportStandby":0,

        "SupportViewRequests":1

      },

      "Name":"AQIC5…"

    },

    "State":{

      "Data":"Ok",

      "Stream":"Open",

      "Text":"Login accepted by host ads-fanout-lrg-az1-apse1-prd."

    },

    "Type":"Refresh"

  }

]

SENT:

{

  "ID":2,

  "Key":{

    "Name":"/TRI.N",

    "Service":"ELEKTRON_DD"

  }

}

RECEIVED:

[

  {

    "Fields":{

      "52WK_HIGH":123.59,

      "52WK_LOW":80.16,

      "52W_HDAT":"2021-11-19",

      "52W_HIND":null,

      "52W_LDAT":"2021-02-22",

      "52W_LIND":null,

      "ACVOL_1":191271,

      "ACVOL_UNS":191271,

      "AC_TRN_CRS":null,

      "AC_VOL_CRS":0,

      "ADJUST_CLS":105.24,

      "AFTMKT_DT":null,

      "AFTMKT_NS":null,

      "AFTMKT_PRC":null,

      "AFTMKT_VOL":null,

      "ASK":0.0,

      "ASKSIZE":0,

      "ASK_1":105.24,

      "ASK_2":105.24,

      "ASK_COND_N":"R",

      …

Connecting to RTO with the V2 authentication

Running the market_price_rdpgw_client_cred_auth.py example

This example retrieves market-price content for a RIC after authenticating with RDP (auth/oauth2/v2/token). The obtained access token is used in inital authentication with Refintiv Real-Time - Optimized (RTO). New tokens are obtained if reconnecting to Real-Time Server. During reconnection attempts, a new token is obtained only if existing token has expired. This example connects to a specified endpoint (host and port) or if unspecified will discover the endpoint information using a service discovery URL using a region supplied as input. The Authentication is 'oAuthClientCred' or RDP version2 (v2) auth which uses client credentials grant with Refintiv provided Service Account credentials: clientid (username) and clientsecret (password).

Run the example with the following parameters:

    	
            sh-4.4# python3 market_price_rdpgw_client_cred_auth.py --clientid <Client ID> --clientsecret <Client Secret>
        
        
    

The output is:

    	
            

sh-4.4# python3 market_price_rdpgw_client_cred_auth.py --clientid <ClientID> --clientsecret <ClientSecret> --ric JPY=

 

2024-06-21 04:57:27.955774 Sending authentication request with client credentials to  https://api.refinitiv.com/auth/oauth2/v2/token ...

 

2024-06-21 04:57:28.797163 Refinitiv Data Platform Authentication succeeded. RECEIVED:

{

  "access_token":"xtsa8aMI3mGkqhH8VPY1B8EB8qiU",

  "expires_in":7199,

  "token_type":"Bearer"

}

 

2024-06-21 04:57:28.797404 Sending Refinitiv Data Platform service discovery request to  https://api.refinitiv.com/streaming/pricing/v1/ ...

 

2024-06-21 04:57:29.709315 Refinitiv Data Platform Service discovery succeeded. RECEIVED:

{

  "services":[

    {

      "dataFormat":[

        "tr_json2"

      ],

      "endpoint":"ap-northeast-1-aws-1-sm.optimized-pricing-api.refinitiv.net",

      "location":[

        "ap-northeast-1a"

      ],

      "port":443,

      "provider":"aws",

      "transport":"websocket"

    },

    {

      "dataFormat":[

        "tr_json2"

      ],

      "endpoint":"ap-northeast-1-aws-3-sm.optimized-pricing-api.refinitiv.net",

      "location":[

        "ap-northeast-1a",

        "ap-northeast-1b"

      ],

      "port":443,

      "provider":"aws",

      "transport":"websocket"

    }...

  ]

}

2024-06-21 04:57:29.712922 Session1: Connecting WebSocket to wss://us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net:443/WebSocket...

2024-06-21 04:57:32.125841 Session1: WebSocket successfully connected!

2024-06-21 04:57:32.126033 SENT on Session1:

{

  "Domain":"Login",

  "ID":1,

  "Key":{

    "Elements":{

      "ApplicationId":"256",

      "AuthenticationToken":"xtsa8aMI3mGkqhH8VPY1B8EB8qiU",

      "Position":"172.17.0.2/f0c33d4c41dc"

    },

    "NameType":"AuthnToken"

  }

}

2024-06-21 04:57:32.840041 RECEIVED on Session1:

[

  {

    "Domain":"Login",

    "Elements":{

      "MaxMsgSize":65535,

      "PingTimeout":30

    },

    "ID":1,

    "Key":{

      "Elements":{

        "AllowSuspectData":1,

        "ApplicationId":"256",

        "ApplicationName":"RTO",

        "AuthenticationErrorCode":0,

        "AuthenticationErrorText":{

          "Data":null,

          "Type":"AsciiString"

        },

        "Position":"172.17.0.2/f0c33d4c41dc",

        "ProvidePermissionExpressions":1,

        "ProvidePermissionProfile":0,

        "SingleOpen":1,

        "SupportBatchRequests":7,

        "SupportEnhancedSymbolList":1,

        "SupportOMMPost":1,

        "SupportOptimizedPauseResume":0,

        "SupportPauseResume":0,

        "SupportStandby":1,

        "SupportStandbyMode":3,

        "SupportViewRequests":1

      },

      "Name":"xtsa8aMI3mGkqhH8VPY1B8EB8qiU"

    },

    "State":{

      "Data":"Ok",

      "Stream":"Open",

      "Text":"Login accepted by host ads-fanout-sm-az2-use1-prd."

    },

    "Type":"Refresh"

  }

]

2024-06-21 04:57:32.840493 SENT on Session1:

{

  "ID":2,

  "Key":{

    "Name":"JPY=",

    "Service":"ELEKTRON_DD"

  }

}

2024-06-21 04:57:33.333816 RECEIVED on Session1:

[

  {

    "Fields":{

      "ACTIV_DATE":"2024-06-21",

      "ACT_TP_1":"B\u21e7",

      "ACT_TP_2":"B\u21e9",

      "ACT_TP_3":"B\u21e7",

      "ACVOL_1":27698,

      "AMERCL_ASK":158.93,

      "AMERCL_BID":158.9,

      "AMERHI_ASK":158.96,

      "AMERHI_BID":158.94,

      "AMERLO_ASK":158.26,

      "AMERLO_BID":158.23,

      "AMEROP_ASK":158.43,

      ...

    },

    "ID":2,

    "Key":{

      "Name":"JPY=",

      "Service":"ELEKTRON_DD"

    },

    "PermData":"AwEBUmw=",

    "Qos":{

      "Rate":"JitConflated",

      "Timeliness":"Realtime"

    },

    "SeqNumber":59294,

    "State":{

      "Data":"Ok",

      "Stream":"Open"

    },

    "Type":"Refresh"

  }

]

2024-06-21 04:57:34.009590 RECEIVED on Session1:

[

  {

    "DoNotConflate":true,

    "Fields":{

      "ACTIV_DATE":"2024-06-21",

      "ACT_TP_1":"B\u21e7",

      "ACT_TP_2":"B\u21e7",

      "ACT_TP_3":"B\u21e9",

      "ACVOL_1":27699,

      "ASIA_BNC":0.61,

      "ASK":158.9,

      "BCKGRNDPAG":"DDBA",

      "BID":158.88,

      "BIDPCTCHNG":-0.01,

      "BID_NET_CH":-0.02,

      "BID_TICK_1":"\u21e7",

      "CTBTR_1":"DANSKE BANK ",

      "CTB_LOC1":"COP",

      "CTB_PAGE1":"DDBA",

      "DLG_CODE1":"DANM  ",

      "DSPLY_NAME":"DANSKE BANK  COP",

      "MID_NET_CH":-0.03,

      "MID_PRICE":158.89,

      "NETCHNG_1":-0.02,

      "NUM_BIDS":27699,

      "OFFCL_CODE":"DANM        ",

      "PCTCHNG":-0.01,

      "PRIMACT_1":158.88,

      "QUOTE_DATE":"2024-06-21",

      "QUOTIM":"04:57:33",

      "QUOTIM_MS":17853095,

      "SEC_ACT_1":158.9,

      "TIMACT":"04:57:00",

      "VALUE_DT1":"2024-06-21",

      "VALUE_TS1":"04:57:33",

      "VALUE_TS2":"04:57:27",

      "VALUE_TS3":"04:57:24"

    },

    "ID":2,

    "Key":{

      "Name":"JPY=",

      "Service":"ELEKTRON_DD"

    },

    "SeqNumber":59310,

    "Type":"Update",

    "UpdateType":"Unspecified"

  },

  {

    "DoNotConflate":true,

    "Fields":{

      "ASIA_NETCH":0.61

    },

    "ID":2,

    "Key":{

      "Name":"JPY=",

      "Service":"ELEKTRON_DD"

    },

    "SeqNumber":59326,

    "Type":"Update",

    "UpdateType":"Unspecified"

  },

  {

    "DoNotConflate":true,

    "Fields":{

      "PCTCHG_3M":4.8,

      "PCTCHG_6M":11.81,

      "PCTCHG_MTD":1.0,

      "PCTCHG_YTD":12.63

    },

    "ID":2,

    "Key":{

      "Name":"JPY=",

      "Service":"ELEKTRON_DD"

    },

    "SeqNumber":59342,

    "Type":"Update",

    "UpdateType":"Unspecified"

  },

  {

    "DoNotConflate":true,

    "Fields":{

      "BID_NET_CH":-0.02,

      "IRGPRC":-0.01

    },

    "ID":2,

    "Key":{

      "Name":"JPY=",

      "Service":"ELEKTRON_DD"

    },

    "SeqNumber":59358,

    "Type":"Update",

    "UpdateType":"Unspecified"

  }

]

Summary

This article introduces Real-Time SDK and Real-Time WebSocket API Docker images in Docker Hub. The lsegrealtime/websocket_api docker image contains WebSocket API Examples used to connect to Real-Time Distribution System or Data Platform to consume real-time data through the WebSocket connections. The lsegrealtime/realtimesdk_c docker image contains the latest version of Real-Time C/C++ libraries and examples. The lsegrealtime/realtimesdk_java docker image contains the latest version of Real-Time SDK Java libraries and examples.

Then, it demonstrates how to deploy the lsegrealtime/websocket_api docker image on the Docker engines and Azure Containers. Finally, it shows how to the Python examples to retrieve real-time data from Real-Time – Optimized.

References

  1. Azure.microsoft.com. 2020. Azure Container Instances | Microsoft Azure. [online] Available at: https://azure.microsoft.com/en-us/services/container-instances/ [Accessed 10 Feb 2022].
  2. Azure.microsoft.com. 2020. Cloud Computing Services | Microsoft Azure. [online] Available at: https://azure.microsoft.com/en-us/ [Accessed 10 Feb 2022].
  3. Hub.docker.com. n.d. Docker Image For  Real-Time SDK C/CPP. [online] Available at: https://hub.docker.com/repository/docker/lsegrealtime/realtimesdk_c [Accessed 10 Feb 2022].
  4. Hub.docker.com. 2020. Docker Image For Real-Time SDK Java. [online] Available at: https://hub.docker.com/r/refinitivapis/realtimesdk_java [Accessed 10 Feb 2022].
  5. Hub.docker.com. 2020. Docker Image For Websocket APIs. [online] Available at: https://hub.docker.com/r/lsegrealtime/websocket_api [Accessed 10 Feb 2022].
  6. Docker Documentation. 2020. Get Docker. [online] Available at: https://docs.docker.com/get-docker/ [Accessed 10 Feb 2022].