Enabling Dynamic Peers

This page provides a guide to using the new Dynamic Peers feature in Platform 8.

Available from: Platform 8

Overview

Dynamic Peers is a new feature in Platform 8 that allows the removal of add-peer configuration items for incoming peer connections, allowing you to dynamically scale the number of provider peers (commonly adapters) at runtime.

For a more detailed overview, see the Dynamic Peers feature overview.

Converting from static to Dynamic Peers

The steps in this section use the following basic deployment as a worked example:

Liberator1192.168.1.100PricingAdapter1# Incoming peer connectionadd-peerremote-label PricingAdapter1end-peer add-data-serviceservice-name PricingServiceadd-source-groupadd-priorityremote-label PricingAdapter1end-priorityend-source-groupend-data-service# Outgoing peer connectionadd-peerremote-label Liberator1addr 192.168.1.100end-peer

Follow the steps below:

  1. In the Liberator configuration, remove the add-peer configuration for the incoming peer connection:

    Liberator1192.168.1.100PricingAdapter1 # Incoming peer connection add-peer   remote-label PricingAdapter1 end-peer add-data-serviceservice-name PricingServiceadd-source-groupadd-priorityremote-label PricingAdapter1end-priorityend-source-groupend-data-service# Outgoing peer connectionadd-peerremote-label Liberator1addr 192.168.1.100end-peer
  2. In the Liberator configuration, edit the data service definition that routes to the peer. Instead of referencing specific peer labels, switch to referencing peer labels by regular expression (remote-label-regex):

    Liberator1192.168.1.100PricingAdapter1 # Incoming peer connection add-peer   remote-label PricingAdapter1 end-peer add-data-serviceservice-name PricingServiceadd-source-groupadd-priority            remote-label PricingAdapter1            remote-label-regex ^PricingAdapter[0-9]+end-priorityend-source-groupend-data-service# Outgoing peer connectionadd-peerremote-label Liberator1addr 192.168.1.100end-peer
  3. In the adapter configuration, declare the adapter a provider of the service 'PricingService', matching the name of the related data service in Liberator:

    Liberator1192.168.1.100PricingAdapter1 # Incoming peer connection add-peer   remote-label PricingAdapter1 end-peer add-data-serviceservice-name PricingServiceadd-source-groupadd-priority            remote-label PricingAdapter1            remote-label-regex ^PricingAdapter[0-9]+end-priorityend-source-groupend-data-service# Outgoing peer connectionadd-peerremote-label Liberator1addr 192.168.1.100end-peer discovery-provide-service PricingService
  4. In the adapter configuration, assign the adapter a unique local label, either with the option add-peer:local-label or the global item datasrc-local-label.

    Liberator1192.168.1.100PricingAdapter1 # Incoming peer connection add-peer   remote-label PricingAdapter1 end-peer add-data-serviceservice-name PricingServiceadd-source-groupadd-priority            remote-label PricingAdapter1            remote-label-regex ^PricingAdapter[0-9]+end-priorityend-source-groupend-data-service# Outgoing peer connectionadd-peerremote-label Liberator1addr 192.168.1.100end-peer discovery-provide-service PricingService datasrc-local-label PricingAdapter1
  5. Restart the adapter and Liberator