Multiple Endpoint Guide

Overview

The Multiple Endpoint feature enables us to send the event data, which is collected via various automatic and manual trigger event methods to multiple infinity endpoints. The objective, in this case, is to process the payload to each endpoint one after the other. ora_dc_end_point_config is the config which holds the end points information. The different collection endpoints can be passed as JSON array as explained below.

Creating an endpoint array

The each element of JSON array is a collection of URL, GUID & Retry Count attributes. Below are the key names in detail

ora_dc_collection_url - An infinity data collection base URL.

ora_dc_account_guid - An account GUID identifies your account. All your tags will use the same account GUID so that all data collected for your account is stored together.

ora_dc_retry_count - Retry count in case of network or server failures. The minimum allowed value is 1, maximum is 15 and default value is 3.

With the above attributes, the JSON array with two different endpoints will looks like

[
{
"ora_dc_collection_url": "https://yourendpoint1.com",
"ora_dc_account_guid": "yourGuidOne",
"ora_dc_retry_count": "2"
},
{
"ora_dc_collection_url": "https://yourendpoint2.com",
"ora_dc_account_guid": "yourGuidTwo",
"ora_dc_retry_count": "4"
}
]

There are two ways to set end point configuration to Oracle CX Core SDK. Either of one can be used to set the config.

1. Adding multiple end point config in oracle.json

{
"config_version": "1.0",
"ORACORE": {
"ora_dc_end_point_config": [
{
"ora_dc_collection_url": "https://yourendpoint1.com",
"ora_dc_account_guid": "yourGuidOne",
"ora_dc_retry_count": "2"
},
{
"ora_dc_collection_url": "https://yourendpoint2.com",
"ora_dc_account_guid": "yourGuidTwo",
"ora_dc_retry_count": "4"
}
]
}
}

2. Setting multiple end points programmatically

Below is the complete code to set endpoints configuration

ORACoreDataContainer container = new ORACoreDataContainer(context);
Map<ORABaseConfigSettings, String> map = new HashMap<>();
map.put(ORABaseConfigSettings.END_POINT_CONFIG, "[" +
"{" +
"\"ora_dc_collection_url\": \"https://yourendpoint1.com\"," +
"\"ora_dc_account_guid\": \"yourGuidOne\"," +
"\"ora_dc_retry_count\": \"2\"}," +
"{" +
"\"ora_dc_collection_url\": \"https://yourendpoint2.com\"," +
"\"ora_dc_account_guid\": \"yourGuidTwo\"," +
"\"ora_dc_retry_count\": \"4\"}" +
"]");
try {
container.loadConfig(map, 1);
} catch (ORAModuleIDException e) {
e.printStackTrace();
}