|
This page provides a high level overview of how X Platform components are configured. It also serves as a reference for the configuration properties supported by the various components.
The diagram above provides a high level depiction of the X Platform's configuration architecture. Salient aspects of this architecture are:
The configuration of X Platform components is tied very closely to the application's lifecycle.
This document is only concerned with the Configure Phase.
X supports different ways to populate a configuration repository depending on whether X is being used in an embedded or non-embedded manner and, if embedded, how the configuration information is distributed and managed.
X is considered to be used in an embedded manner when the application's main entry point is in the application code. When used in this manner, the following are the supported mechanisms by which the configuration repository can be populated:
Component Descriptors: Each platform component is accompanied by a companion configuration descriptor that is used to programmatically configure the component. In addition to implementing setters and getters to set and get configuration attributes, descriptors also implement the ability to save configuration properties to the repository. This allows for application code to programmatically seed configuration information into the repository. This mechanism is suited for use when platform related configuration cannot be easily transformed to XML form. The following are the various descriptor classes:
Project | Component Name | Descriptor Class |
---|---|---|
Talon | SMA Bus | com.neeve.sma.MessageBusDescriptor |
Talon | SMA Channel | com.neeve.sma.MessageChannelDescriptor |
Talon | ODS Persister | com.neeve.ods.StorePersisterDescriptor |
Talon | ODS ICR Descriptor | com.neeve.ods.StoreInterClusterReplicatorDescriptor |
Talon | ODS Store Descriptor | com.neeve.ods.StoreDescriptor |
Talon | AEP Engine | com.neeve.aep,AepEngineDescriptor |
Configuration Script: X supports an internal scripting format using which the configuration repository can be populated.
This mechanism is used internally by X and is not recommended for external use. It is only listed here for information purpose to avoid confusion when script related trace appear in X's trace logs |
The X Platform is considered to be used in a non-embedded manner when the application's main entry point is in a Talon Server. When used in this manner, the configuration repository is initialized from external storage via the configured persistence plugin. It is recommended that Robin be used for the configuration, deployment and management of X applications when X is used in a non-embedded manner. The Robin framework uses the same XML descriptor as described above to configure the platform. However, processes the XML descriptor is a manner that allows for the platform configuration and application code to be deployed using independent channels such that the configuration materializes in the Talon server from external storage when the server is launched. Refer to the Robin documentation for further information on how to use the X Platform in a non-embedded manner.
Note: It is possible to materialize configuration into the repository from external storage even when operating in embedded mode. However, that puts the burden of responsibility of managing, distributing and storing the platform configuration is the appropriate format and location external to the process so that the configuration is picked up correctly from the external storage. This responsibility is picked up by Robin when operating in non-embedded mode. |
X supports describing and initializing platform configuration using XML via its Domain Descriptor Language schema (x-ddl.xsd). This section describes commonly used DDL configuration elements, more detail can be found in DDL Schema Reference, which discusses all of the attributes in more detail.
The XML document above is a sample configuration document. The document describes a multi-agent application scenario.
<?xml version="1.0"?> <model xmlns="http://www.neeveresearch.com/schema/x-ddl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <buses> <bus name="frontoffice" descriptor="${FRONTOFFICE_BUSDESCRIPTOR::falcon://fastmachine:8040}"> <channels> <channel id="1" name="orders"> <qos>Guaranteed</qos> </channel> <channel id="3" name="events"> <qos>BestEffort</qos> </channel> </channels> </bus> </buses> <apps> <app name="forwarder" mainClass="com.neeve.samples.Forwarder"> <messaging> <bus name="frontoffice"> <channels> <channel name="orders" join="true"/> <channel name="events" join="false"/> </channels> <detachedSend enabled="${FORWARDER_FRONTOFFICEDETACHEDSEND::true}"> <queueDepth>1024</queueDepth> <queueOfferStrategy>SingleThreaded</queueOfferStrategy> <queueWaitStrategy>BusySpin</queueWaitStrategy> <queueDrainerCpuAffinityMask>${FORWARDER_FRONTOFFICEDETACHEDSENDCPUAFFMASK::0}</queueDrainerCpuAffinityMask> </detachedSend> </bus> </messaging> <storage descriptor="${FORWARDER_STOREDESCRIPTOR::native://.}"> <persistence> <pageSize>16384</pageSize> <detachedPersist enabled="false"/> </persistence> </storage> </app> <app name="receiver" mainClass="com.neeve.samples.Receiver"> <messaging> <bus name="frontoffice"> <channels> <channel name="orders" join="true"/> </channels> </bus> </messaging> </app> <app name="sender" mainClass="com.neeve.samples.Sender"> <messaging> <bus name="frontoffice"> <channels> <channel name="orders" join="false"/> <channel name="events" join="true"/> </channels> </bus> </messaging> </app> </apps> <servers> <server name="forwarder1"> <apps> <app name="forwarder" autoStart="true"/> </apps> </server> <server name="forwarder2"> <apps> <app name="forwarder" autoStart="true"/> </apps> </server> <server name="receiver"> <apps> <app name="receiver" autoStart="true"/> </apps> </server> <server name="sender"> <apps> <app name="sender" autoStart="true"/> </apps> </server> </servers> </model> |
<bus name="frontoffice" descriptor="${FRONTOFFICE_BUSDESCRIPTOR::falcon://fastmachine:8040}"> <channels> <channel id="1" name="orders"> <qos>Guaranteed</qos> </channel> <channel id="3" name="events"> <qos>BestEffort</qos> </channel> </channels> </bus> |
The 'buses' section configures the various messaging buses in use in the scenario. For example, the above configures a messaging bus named 'frontoffice' that
When configuring the platform using the VMConfigurer class, the environment is the composition of the user property table, process environment and Java system properties in that order of precedence. |
<apps> <app name="forwarder" mainClass="com.neeve.samples.Forwarder"> <messaging> <bus name="frontoffice"> <channels> <channel name="orders" join="true"/> <channel name="events" join="false/"> </channels> <detachedSend enabled="${FORWARDER_FRONTOFFICEDETACHEDSEND::true}"> <queueDepth>1024</queueDepth> <queueOfferStrategy>SingleThreaded</queueOfferStrategy> <queueWaitStrategy>BusySpin</queueWaitStrategy> <queueDrainerCpuAffinityMask>${FORWARDER_FRONTOFFICEDETACHEDSENDCPUAFFMASK::0}</queueDrainerCpuAffinityMask> </detachedSend> </bus> </messaging> <storage descriptor="${FORWARDER_STOREDESCRIPTOR::native://.}"> <persistence> <pageSize>16384</pageSize> <detachedPersist enabled="false"/> </persistence> </storage> </app> <app name="receiver" mainClass="com.neeve.samples.Receiver"> . . . </app> <app name="sender" mainClass="com.neeve.samples.Sender"> . . . </app> </apps> |
The 'app's section configures the various applications in the scenario. An application is synonymous with an AEP engine. For example, the above configures three applications (i.e. engines)
An application's entry point is used by a Talon Server as the main application class to load |
Messages associated with channels indicate the default channel over which a message is sent and forms part of messaging ROE between application agents. |
<servers> <server name="forwarder1"> <apps> <app name="forwarder" autoStart="true"/> </apps> </server> <server name="forwarder2"> <apps> <app name="forwarder" autoStart="true"/> </apps> </server> <server name="receiver"> <apps> <app name="receiver" autoStart="true"/> </apps> </server> <server name="sender"> <apps> <app name="sender" autoStart="true"/> </apps> </server> </servers> |
The 'servers' sections configures the various Talon servers in the scenario. For example, the above configures four Talon Servers.