GASSelector Thing
The GASSelector Thing is the default GAS Selector provided by the Remote Access Extension (RAE). Derived from the ThingWorx GenericThing Thing Template, the GASSelector Thing implements the SelectServer service from the GASSelectorService Thing Shape. When it runs, this GASSelector Thing chooses the appropriate GAS for a remote session. When GAS pinning is enabled, the available GAS Things are filtered based on the pinningType property. The following steps explain how this implementation selects a GAS for a remote session:
1. Query all GAS instances that are online and enabled.
When GAS pinning is enabled, filtering is applied to list the available GAS servers based on the defined country, region, or GAS Thing name.
2. Remove all GAS instances that have no available sessions or their healthy property status is False.
3. Remove all GAS instances whose invalidToken property has a value of true.
4. Any servers found?
If no servers are found, return an error.
If one server is found, check the healthy property and connect to the GAS server.
5. If more than one "closest" instance is found, find the closest instance(s), as determined by the absolute difference in timezone offset.
6. Connect to the healthy instance with the least number of sessions.
If the server is not healthy, remove it from the list and repeat step 6.
The following services are used for GAS pinning:
GetServersByCountry—Takes a country value as input and returns a list of GAS Things that have the property value of country.
GetServersByRegion—Takes a region value as input and returns a list of GAS Things that have the property value of country.
Was this helpful?