Configuring a RET Adapter
You can find general information on changing adapter properties in the online developer documentation: Configuring your RET Adapters.
From completing the previous training modules in this series, you should by now have a running environment along with all the RET adapters exported as blades. If you were to connect your current environment and Caplin’s back-end systems (Caplin Platform) to a Caplin front-end application (for example, Caplin FX Professional Motif) you would be able to see trading data and carry out ESP (executable streaming price) trades.
In this tutorial you will learn how to configure the behaviour of your adapters by changing their configuration files - namely adapters.properties
and trapi-configuration.properties
. You can find these files inside your Deployment Framework directory under /global_config/overrides/<Adapter>/etc/
.
Download the presentations for this course.
Objectives
You will look at ways of modifying default RET adapter behaviour using existing config options, where you will:
-
Edit specific configuration files for each of the RET Adapters.
-
Look at configuring the RET connection properties as well as defining various adapter properties.
There are different ways to configure the RET Adapters depending on what layer and which connection you are looking at.
Using the Deployment Framework to configure your adapters
The adapter configuration options for the datasource as well configuring the datasource behaviour with Liberator and Transformer can be found in this document: Change server-specific configuration. You can refer to the examples contained in that documentation as a guide.
Configuring adapter.properties
The global_config/overrides/<Adapter>/etc/adapter.properties
file defines the behaviour of an adapter. For detailed descriptions of the available configuration options, see Configuration file: adapter.properties.
Example adapter.properties
config, displaying the various options available:
# Common adapter settings
# Time gap between two trades for the same currency
# one_click_gap_time=
# Time interval for JMX statistics publishing
# jmx_publish_interval=
# Enables the director user manager
# use_director_user_manager=
# These are the precious metal unit conversions.
metal_conversion=XAUUSD:[KG 995, 31.99], [KG 999, 32.12], [KG 9999, 32.148], [100G 999, 3.212], [10 TOLA, 3.746]
metal_conversion=XAGUSD:[KG,32.1507], [TON, 32150.7]
metal_conversion=XPTUSD:[KG, 32.150722]
metal_conversion=XPDUSD:[KG, 32.150722]
# Error messages from RET - example for a FxTradingAdapter
message_translation=code:100,category:TradeRejection,pattern:.*client price has been expired.*
message_translation=code:101,category:TradeRejection,pattern:.*not favour to bank.*
message_translation=code:102,category:TradeRejection,pattern:.*gap time period.*
message_translation=code:103,category:TradeRejection,pattern:.*No manual trader currently logged in.*
message_translation=code:104,category:TradeRejection,pattern:.*One click deal do not have valid price.*
message_translation=code:105,category:TradeRejection,pattern:^Trading in currency .+ has been suspended$
message_translation=code:106,category:TradeRejection,pattern:.*Trader terminated.*
message_translation=code:107,category:TradeRejection,pattern:^Represented user .+ does not have permission to submit this order$
message_translation=code:108,category:TradeRejection,pattern:.*Streamtime expired.*
message_translation=code:109,category:TradeRejection,pattern:.*Taker log differs from submit XML.*
message_translation=code:110,category:TradeRejection,pattern:.*Less than.*seconds since last trade.*
message_translation=code:111,category:TradeRejection,pattern:.*is not a valid settlement date.*
message_translation=code:112,category:TradeRejection,pattern:.*Credit violation - Counterparty mismatch.*
message_translation=code:113,category:TradeRejection,pattern:.*Unable to accept old price.*
message_translation=code:114,category:TradeRejection,pattern:.*Price timeout.*
message_translation=code:115,category:TradeRejection,pattern:.*Deal failed arbitration.*
message_translation=code:116,category:TradeRejection,pattern:.*One Click Trading is not allowed.*
# OrderAdapter
# Set this to true to enable the alert feature for orders
enable_order_alerts=false
# The order statuses that trigger an alert on the front end.
alert_on_status=Submitted
alert_on_status=Cancelled
alert_on_status=Deleted
alert_on_status=Done
alert_on_status=Completed
alert_on_status=Active
alert_on_status=Dormant
alert_on_status=Expired
alert_on_status=Rejected
alert_on_status=Activating
alert_on_status=Cancelling
alert_on_status=Deactivating
# FxTradingAdapter
# Enable to check time gap between two trades for the same currency
use_global_one_click_gap_time=false
# LBNAdapter
# How many days to fetch for historic blotter and hour when to restart the adapter # historic_blotter_days_to_fetch= # blotter_rollover_hour=
# Set this if you want the executed & historic blotters to show
# only the completed deals. Otherwise don't set these attributes as by default they are both false.
executed_blotter_display_only_completed_deals=false
historic_blotter_display_only_completed_deals=false
# PermissioningAdapter
# Load permissions from different sources in one transaction instead of separate once
load_permissions_in_single_transaction=true
Message Translations
Message translations are regular expressions that match any exceptions thrown by Refinitiv APIs that we then map to an error code. With the Caplin FX Professional web app, this allows you to handle errors more effectively.
If the adapter receives an error message via RET and there is no matching message translation defined, the Adapter will then send out a default error code. This code will be 199
for all RET Adapters except for the Order Adapter, where the code will be 299
instead.
Configuring the adapter.properties
file is dependant on how your RET system integration is setup, this makes it difficult to generate specific error behaviour. Therefore, while we don’t provide any exercises on configuring adapter.properties
you are free to play around with some of the options available providing that your system allows it.
Configuring the connection to TrAPI
The trapi-connection.properties
file is used to define the behaviour of the connection between the adapter and the RET system, via the Refinitiv Trading API (TrAPI). You can access these connection properties under global_config/overrides/<Adapter>/etc/trapi-connection.properties.
All trapi-connection.properties
config for an adapter can be found either inside the adapters trapi-connection.properties
file, or in templates that are available within the documentation folder inside CaplinRETAdapterSuite.
Try this yourself
If you remember previously, you made some changes to the trapi-connection.properties
in the Creating a RET Adapter training module to connect to your RET system for each adapter.
In following exercise you will learn how to change a configuration option to load only a specific set of properties.
-
Find
global_config/overrides/CalendarAdapter/etc/trapi-configuration.properties
and add the following configuration for all your adapters:currency_pairs_to_load=EURUSD,GBPUSD,USDCAD,USDCHF,EURGBP
-
As you have made changes to a configuration file in the adapters, you will need to restart them. Do this by opening a Cygwin console on your machine and navigating to your Deployment Framework’s topmost directory. Then execute the following command:
./dfw start
The configuration change we made to /trapi-configuration.properties
is helpful when analysing bugs with a smaller set of currencies, and it enables adapters to load faster.
Now open the Caplin FX Professional web app. The tiles frame drop-down should now show fewer options.
You see currency pairs as well as their inverse currency pairs, if provided by the RET system. |