...
- XML Descriptor: The platform allows an application to describe an application's entire configuration in XML form and programmatically initialize a repository using the XML descriptor. XML Configuration is defined by the Domain Descriptor Language schema, x-ddl.xsd. This is the recommended mechanism if an application can store the platform configuration in XML form, or can convert the configuration from its own form to XML to be supplied to the platform for configuration.
- The application should use the com.neeve.VMConfigurer class to configure the platform using an XML descriptor
- The XML Descriptor is described by its corresponding x-ddl.xsd schema. Usage of XML is described below, and in even greated detail in the DDL Schema Reference documentation.
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 TalonDescription SMA Bus com.neeve.sma.MessageBusDescriptor TalonConfigures a Bus SMA Channel com.neeve.sma.MessageChannelDescriptor TalonConfigures a Bus Channel ODS PersisterStore Descriptor com.neeve.ods. StorePersisterDescriptorTalon ODS ICRStoreDescriptor Configures the Store for an Engine (providing HA) ODS Store Replicator Descriptor com.neeve.ods. StoreInterClusterReplicatorDescriptorTalon ODS StoreStoreReplicatorDescriptor Configures store replication to backup members ODS Persister com.neeve.ods.StorePersisterDescriptor Configures store disk persistence ODS ICR Descriptor com.neeve.ods.StoreDescriptorTalonStoreInterClusterReplicatorDescriptor Configures store inter cluster replication (e.g. remote data center) AEP Engine com.neeve.aep,AepEngineDescriptor Configures the applications AepEngine XVM (Talon Server) Configures an XVM Note, that with the exception of the SrvConfigDescriptor, it is possible for an application to augment configuration seeded by the XML configuration descriptor programattically with the component descriptor:
Code Block java java @AppInjectionPoint public void setAepEngineDescriptor(AepEngineDescriptor appDescriptor) { appDescriptor.setAppExceptionHandlingPolicy(LogExceptionAndContinue); appDescriptor.save(); if(appDescriptor.getStore() != null) { StoreDescriptor storeDescriptor = StoreDescriptor.load(appDescriptor.getStore()); storeDescriptor.setPersistenceQuorum(1); storeDescriptor.save(); } }
Configuration Script: X supports an internal scripting format using which the configuration repository can be populated.
Note 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
...
Code Block | ||
---|---|---|
| ||
<?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> <buses> <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> </buses> </messaging> <storage descriptor="${FORWARDER_STOREDESCRIPTOR::native://.}"><storage> <clustering> <localIfAddr>${FORWARDER_REPLICATION_INTERFACE::localhost}</localIfAddr> <localPort>12000</localPort> </clustering> <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> |
...
Tip |
---|
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. |
Applications (AEP Engines)
Code Block | ||
---|---|---|
| ||
<apps> <app name="forwarder" mainClass="com.neeve.samples.Forwarder"> <messaging> <buses> <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> </buses> </messaging> <storage descriptor="${FORWARDER_STOREDESCRIPTOR::native://.}"><storage> <clustering> <localIfAddr>${FORWARDER_REPLICATION_INTERFACE::localhost}</localIfAddr> <localPort>12000</localPort> </clustering> <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 engine named 'forwarder',
- whose main entry point is "com.neeve.samples.Forwarder".
- who is interested in receiving messages (i.e. subscribing to) on the 'orders' channel.
- who sends messages over the 'events' channel.
- who operates its 'frontoffice' bus connection manager in a detached send manner i.e. message serialization happens in a thread different from the business logic thread.
- who performs store persistence in an attached manner with a page size of 16K.
- .
- .
- .
- An engine named 'receiver',
- whose main entry point is "com.neeve.samples.Receiver".
- .
- .
- .
- An engine named 'sender',
- whose main entry point is "com.neeve.samples.Sender".
- .
- .
- .
Tip |
---|
An application's entry point is used by a Talon Server as the main application class to load. |
Tip |
---|
Messages associated with channels indicate the default channel over which a message is sent and which forms part of messaging ROE between application agents. |
Talon Servers (XVMs)
Code Block | ||
---|---|---|
| ||
<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.
- The 'forwarder1' and 'forwarder2' servers are configured to manage the clustered 'forwarder' application.
- All applications of the same name will join to form a cluster.
- The 'receiver' server configured to manage the standalone 'receiver' application.
- The 'sender' server configured to manage the standalone 'sender' application.