- Last update: July 2019
- Environment: Windows and Linux OS
- Compiler: Python
- Prerequisite: ADS and ADH servers version 3.2.1 and above, RCC Access Credentials
The Refinitiv Contribution Channel (RCC - formerly known as TRCC) is a new service for on-boarding content to the Refinitiv. Depending on the client's needs, access to the service will be fulfilled by one or more of the following products: Contributions Channel for TREP, Contributions Channel for Elektron API, Contributions Channel for Spreadsheet. RCC aims for replacing the legacy Market Link IP (MLIP) system.
Data Contribution is a means to send your pricing data directly to Refinitiv , from where it can fan out globally. Leading market participants, such as banks and brokers, use Refinitiv to publish and distribute their information to the community of financial professions, in order to advertise their prices to clients and prospects.
This example shows how to writing an application to contribute your data to RCC using Elektron WebSocket API through Thomson Reuters Enterprise Platform (TREP). The example just connects to TREP via a WebSocket connection, then sends an off-stream post to contribute item to RCC server via that TREP. The project are implemented with Python language for both console and Jupyter Notebook applications, but the main concept and post message structures are the same for all technologies.
If you are interested to contribute data using the RSSL connection (with or without TREP), please visit the following series of Elektron SDK and RCC based on your prefer API:
- Contributing your data to Refinitiv article.
- EMA Java Tutorial - Posting data to Contribution Channel.
- EMA C++ Tutorial - Posting data to Contribution Channel.
If you are not familiar with Elektron WebSocket API Posting concept, please visit Contributing Data to TREP using the Websocket API article which will give you a full explanation of the WebSocket API Posting mechanisms and process.
Note: In an off-stream post, the client application can send a post for an item via a Login stream, regardless of whether a data stream first exists. The route of the post is determined by the TREP (ADS and ADH) configuration.
The Elektron WebSocket API cannot connect to RCC server directly (only Elektron SDK C++ and Java APIs support that feature). It requires TREP version 3.2.1 (and above) to take care of the JSON-OMM conversion, RCC connection and login process for the WebSocket application.
The TREP infrastructure connects to RCC through the delivery direct network via Tunnel Stream Aggregator (TSA) adapter, which is a private network (TLS encrypted) between a client site and Refinitiv. The TSA adapter is already packaged with the ADH version 3.2, and needs to be configured. You can find more detail regarding the TREP-RCC configurations in Contributing your data to Refinitiv article page (Contribution through TREP section). This example also contain example ADH-RCC configurations in trep_config/rmds_trcc.cnf file.
This example requires the following dependencies softwares and libraries.
- TREP server (both ADS and ADH) 3.2.x with WebSocket connection.
- Python compiler and runtime
- Python's requests 2.x library.
- Python's websocket-client library (version 0.49 or greater).
- Jupyter Notebook runtime (for the Notebook example application)
- Docker Engine - Community Edition (for running the console example in Docker only)
- RCC username, password and host list credentials. Please reach out to your Refinitiv sales associate to acquire RCC access credentials.
Note:
- The Python example has been qualified with Python versions 3.6.8.
- Please refer to the pip installation guide page if your environment does not have the pip tool installed.
- If your environment already have a websocket-client library installed, you can use
pip listcommand to verify a library version, then usepip install --upgrade websocket-clientcommand to upgrade websocket-client library. - You can install Jupyter Notebook on your local machine and then test the example on the machine. The alternate choice is a free Jupyter Notebook on cloud environment such as Azure Notebook provided by Microsoft. You can find more details from this tutorial. If you are not familiar with Jupyter Notebook, the following tutorial created by DataCamp may help.
- It is not advisable to change the ADH configuration, if you are not familiar with the configuration procedures. Please consult your Market Data administrator for any questions regarding ADH-RCC configuration.
This example project contains the following files and folders
- console_python/trcc_posting.py: The example application file
- console_python/requirements.txt: The application dependencies configuration file
- console_python/Dockerfile: The example application Dockerfile
- notebook_python/trcc_posting_notebook.ipynb: The example Jupyter Notebook application file
- trep_config/rmds_trcc.cnf: ADH RCC configurations example file (not a completed ADH configuration file)
- LICENSE.md: Project's license file
- README.md: Project's README file
Please be informed that your TREP server (ADS and ADH) should be applied the RCC configurations and RCC contribution service should be "Up" before running an example. The RCC access credentials are required in the connection between ADH server and RCC server only, not in the application level.
- Unzip or download the example project folder into a directory of your choice.
- Enter project console folder.
- Run
$> pip install -r requirements.txtcommand in a console to install all the dependencies libraries. - Then you can run trcc_posting.py application with the following command
$> python trcc_post.py --hostname <ADS server IP Address/Hostname> --port <WebSocket Port> --item <Contribution item name> --service <ADS Contribution Service name>
- Unzip or download the example project folder into a directory of your choice.
- Enter console folder.
- Run
$> docker build -t <project tag name> .command in a console to build an image from a Dockerfile.$> docker build -t esdk_ws_rcc_python . - Once the build is success, you can create and run the container with the following command
$> docker run esdk_ws_rcc_python --hostname <ADS server IP Address/Hostname> --port <WebSocket Port> --item <Contribution item name> --service <ADS Contribution Service name>
Note: If you want to connect a docker application to your localhost ADS server, please refer to this Stack Overflow answer page.
Connecting to WebSocket ws://localhost:15000/WebSocket ...
WebSocket successfully connected!
SENT:
{
"Domain":"Login",
"ID":1,
"Key":{
"Elements":{
"ApplicationId":"256",
"Position":"10.42.68.162"
},
"Name":"root"
}
}
RECEIVED:
[
{
"Domain":"Login",
"Elements":{
"MaxMsgSize":61430,
"PingTimeout":30
},
"ID":1,
"Key":{
"Elements":{
"AllowSuspectData":1,
"ApplicationId":"256",
"ApplicationName":"ADS",
"Position":"10.42.68.162",
"ProvidePermissionExpressions":1,
"ProvidePermissionProfile":0,
"SingleOpen":1,
"SupportBatchRequests":7,
"SupportEnhancedSymbolList":1,
"SupportOMMPost":1,
"SupportOptimizedPauseResume":1,
"SupportPauseResume":1,
"SupportStandby":1,
"SupportViewRequests":1
},
"Name":"root"
},
"State":{
"Data":"Ok",
"Stream":"Open",
"Text":"Login accepted by host apis30."
},
"Type":"Refresh"
}
]
Sending Off-Stream Post to TREP Server
SENT:
{
"Ack":true,
"Domain":"MarketPrice",
"ID":1,
"Key":{
"Name":"<CONTRIBUTION_RIC>",
"Service":"<CONTRIBUTION_Service>"
},
"Message":{
"Domain":"MarketPrice",
"Fields":{
"ASK":35.48,
"BID":34.25,
"PRIMACT_1":116.5
},
"ID":0,
"Key":{
"Name":"<CONTRIBUTION_RIC>",
"Service":"<CONTRIBUTION_Service>"
},
"Type":"Update"
},
"PostID":1,
"PostUserInfo":{
"Address":"10.42.68.162",
"UserID":256
},
"Type":"Post"
}
Here
RECEIVED:
[
{
"AckID":1,
"ID":1,
"Key":{
"Name":"<CONTRIBUTION_RIC>",
"Service":"<CONTRIBUTION_Service>"
},
"Type":"Ack"
}
]
- Refinitiv Elektron SDK Family page on the Refinitiv Developer Community web site.
- Refinitiv Elektron WebSocket API page.
- Developer Webinar Recording: Introduction to Electron WebSocket API.
- Contributing Data to TREP using the Websocket API article.
- Contributing your data to Refinitiv article.
- Refinitiv Elektron: RIC Search.
- Refinitiv Data Model Discovery page: Explore TR data models, content definitions and data update behaviors.
- EMA Java Tutorial - Posting data to Contribution Channel.
- EMA C++ Tutorial - Posting data to Contribution Channel.
For any question related to this example or Elektron WebSocket API, please use the Developer Community Q&A Forum.


