The services are primarily configured during the CM4D Results Services installation. Following installation, these settings are also available via the appsettings.json file in the corresponding service directory. The configuration in the file is overwritten by information from other configuration providers that define certain key/value pairs. This is mainly relevant for docker installations.
Database Connections
The connections strings for the CM4D Site Database and CM4D Results Database are the most important settings as they allow the services to connect to one another.
- Results Sender Service - Requires the database connection string for NServiceBus transport/persistence and the CM4D Site database connection string.
- Results Loader/StreamCacheSmith Services - Require the database connection string for NServiceBus transport/persistence and the CM4D Results database connection string.
If CM4D is installed on the same machine, the database connections are typically set via the CM4D.4ds file. However, this is not the case for Docker containers where the settings are typically set via environment variables. The Results Loader service can work without any connection to the CM4D Site database (e.g. in the cloud connected via a RabbitMQ queue) if the CM4DDSFilePath parameter it is explicitly set in the appsettings.json or via an environment variable.
If CM4D is installed on the same machine, the database connections are typically set via the CM4D.4ds file. However, this is not the case for Docker containers where the settings are typically set via environment variables. The Results Loader service can work without any connection to the CM4D Site database (e.g. in the cloud connected via a RabbitMQ queue) if the CM4DDSFilePath parameter it is explicitly set in the appsettings.json or via an environment variable.
AppSettings for Results Services
This document describes the configuration variables stored in the services' appsettings.json files for Results services configuration. All elements can be configured to align with different system requirements.
Application settings for the running service can depend on multiple sources, environment variables, client secrets, Azure Key Vault and from a file appsettings.json. Each layer of configuration belongs to a specific hierarchy, which will not be fully covered in this document.
Each of the Results services has its own appsettings file and although some elements are common to all of the Results services, others may be isolated for a specific service. Hover the cursor over the element label footnote where indicated (e.g., Outbox‡) for quick information or jump to the key here.
|
ResultsConcurrencyLimitResults Loader Only†: The number of threads Results Loader will use to process results concurrently (at the same time). The default is set to unlimited (0), but you may set this to a set number of processing threads. Keep in mind that this is system depends on the server hardware and the number of CM4D instances that are run by Results Launcher, so each thread greater than one will increase the resource consumption on that system. You may need to try different settings per computer to find the optimal performance for Results Loader threads. ExportRootStreamCacheSmith Only‡: The path to the folder used by StreamCacheSmith to store 3D model files for CM4D Peruse that are exported from CM4D. The StreamCacheSmith service creates any necessary subfolders in this root location. HOOPS Communicator references this directory to load 3D Models in CM4D Peruse. |
|
|
ResultsDatabaseResults Loader and StreamCacheSmith**: Connection string to ATS CM4D Results database. Only required here if not running the service locally to the CM4D installation and cannot connect directly using the 4DS file. SiteDatabase: Connection string to ATS CM4D Site database. Only required here if not running the service locally to the CM4D installation and cannot connect directly using the 4DS file. |
|
|
ServiceControl: Facilitates and monitors messages between the CM4D and Results databases.
|
|
|
Endpoint:
|
|
|
|
|
|
|
|
|
|
|
Serilog: Configuration section for Serilog log functionality. Logging of information is important for troubleshooting of services. The following logging options are available:
|
|
|
Allowed HostsResults Sender Only*: Specifies a list of hostnames that are allowed to access the application. By default, this is set to a wildcard to allow all hosts. Multiple hosts are separated with a comma. Decimal PlacesResults Sender Only*: Specify the number of decimal places for the Value column in the Results database. By default, Precision is set to 6 (e.g., 0.000001). Values beyond the sixth decimal place are not stored in the Results database. Similar to the Compare Precision setting in CM4D. Process DataSourcesResults Sender Only*: Restrict a Results Sender instance to process only specified Managed Datasources; filter by all datasources in a Site or by Site/Datasource label. The Results Sender service processes the database changes in CM4D for export. Distributed installations with databases in different regions that are organized within a single Site may cause inefficiencies. For example, if a Results Sender service in Europe processes changes for a database in Asia. A configuration option allows you to restrict a Results Sender instance to process only specified Managed Datasources. It is possible to configure a datasource via DataSource label or to specify a Site and include all Datasources in that Site. Hide optionsShow options
Max Parallel ProcessingResults Sender Only*: Maximum number of parallel Routines to be processed if the complete database is transferred [default: 10]. Job Batch SizeResults Sender Only*: The number of entries in the Results export queue (used during processing Results from CM4D to the Results database) can become busy if you are moving a large amount of data. Customizing the processing configuration may improve overall performance. Set this option to the number of commands processed in each transaction [default: 100]. Scan Queue Interval When IdleResults Sender Only*: Milliseconds between two table scans if no entry was processed [default: 1000]. Scan Queue Interval When FoundResults Sender Only*:Milliseconds between two table scans if entries have been processed [default: 100]. Remove Processed AfterResults Sender Only*: Set the length of time that records are retained in the ResultsCommandQueue database table; value is minutes to wait before deleting commands that have been successfully processed (Status: 2) [default: 2880]. |
|
| Footnote Key | |
| * | Results Sender Only |
| ** | Results Loader and StreamCacheSmith Only |
| † | Results Loader Only |
| †† | Results Sender and Loader Only |
| ‡ | StreamCacheSmith Only |
Provider Options for Dockers
File: The primary configuration provider uses the appsettings.json file in the corresponding service directory.
Environment Variable Configuration: Hierarchy levels are separated by a double underscore.
“section1”: {
“section2”: {
“key”: “value”
}
}
}
In an appsettings.json file this would be:
set section1__section2__key=”value”
Command Line: Key/value pairs can be passed via the command line in three ways:
- with a -- and =: --section1__section2__key=”value”
- with a -- and a space: --section1__section2__key ”value”
- with a / and a space: /section1_section2__key “value”
CM4D.4ds: A CM4D.4ds provider can set the following two parameters from the CM4D Site database. The CM4D.4ds file is located via the registry key HKEY_LOCALMACHINE\Software\Applied Tech Systems\CM4D (Windows machines only) or the location of the service assembly. The file path can be set explicitly via the configuration key “CM4D4DSFilePath” in the appsettings.json file.
{ “ConnectionStrings”: {
“SiteDatabase”: “”,
“ResultsDatabase”:””
}
}
Can we improve this topic? Click Send Feedback in the upper right of the screen to share your comments!