Dynamic Data Services

Dynamic Services enables adapters to configure Liberator and Transformer with data routing rules at the time of peer connection.

Available from: Platform 8

Contents:

Overview

Data services specify the data routing rules in Caplin Platform, mapping subject requests to the DataSource instances that serve them.

Statically defined data-services are defined with add-data-service in the configuration of consuming DataSources, such as Liberator. Adding static routing rules for a new adapter requires downtime to define a new data-service in the consuming peers' configuration.

Liberator1192.168.1.100PricingAdapter1192.168.1.50datasrc-local-label Liberator1 # Incoming peer connectionadd-peerremote-label PricingAdapter1end-peer add-data-serviceservice-name PricingServiceinclude-pattern ^/FXadd-source-groupadd-priorityremote-label PricingAdapter1end-priorityend-source-groupend-data-servicedatasrc-local-label PricingAdapter1 # Outgoing peer connectionadd-peeraddr 192.168.1.100port 14001end-peer
Static peer configuration and static data-service configuration

In contrast, dynamically defined data-services are configured using add-provided-data-service in the configuration of the providing DataSources and are applied to consuming DataSources in the peer connection handshake. Consuming peers do not need to be restarted after receipt of a provided data-service.

Liberator1192.168.1.100PricingAdapter1192.168.1.50datasrc-local-label Liberator1 add-apikey "f9912b266...ea25e047"    "ds-connect,ds-dynamic-peer,    ds-dynamic-service,ds-dynamic-fields"datasrc-local-label PricingAdapter1 # Outgoing peer connectionadd-peeraddr 192.168.1.100port 14001  apikey "9702ff...029b491"end-peer add-provided-data-service    service-name PricingService    apply-if-label ^Liberator[0-9]+    include-pattern ^/FX    remote-label-regex ^PricingAdapter[0-9]+end-provided-data-service 
Dynamic peer configuration and dynamic service configuration

In the configuration above, Liberator contains no static add-peer or add-data-service configuration for the connecting adapter. It does, however, now define an API key that all connecting peers must bear. API keys are not a requirement for dynamic configuration, but we recommend them for production deployments.

In Platform 8, API keys are a new way to manage trust in deployments where new adapters can connect to live deployments and provide configuration for Liberator and Transformer. Deployment administrators can configure API keys with specific levels of authorisation depending on requirements. The API keys in Liberator and Transformer configuration files are SHA256 hashed, protecting them if server security is compromised.

Within a system, there can be a mixture of dynamic and statically configured data services. However, a dynamic service cannot update a statically configured service.

If multiple adapter instances provide the same dynamic service configuration, the configuration of the last instance to connect applies. This means that an adapter connecting later will override configuration set by earlier connecting instances.

The adapter that sends the service definition doesn’t have to be the adapter that supplies the data.

Dynamic Services do not support source affinity. If you require source affinity, either use a statically defined data service or use Discovery, which supports source affinity in dynamic, scalable deployments.

Dynamic data services enforce load-balancing and automatically re-balance requests across providing instances. To disable automatic re-balancing, set the global option service-rebalance-time to -1 in the Liberator or Transformer.


See also: