SOW/Topic
This section describes the configuration options for recording a Topic in the State of the World.
All SOW topics require a basic definition of the messages to be recorded.
Element | Description |
(required) | Type of messages to be stored. To use AMPS generated SOW keys, the message type specified must support content filtering so that AMPS can determine the SOW key for the message. All of the default message types, except binary, support content filtering. Since the binary message type does not support content filtering, that type can only be used for a SOW when publishers use explicit keys. See the Message Types in the AMPS User Guide for a discussion of the message types that AMPS loads by default. Some message types (such as Google Protocol Buffers) require additional configuration, and must be configured before using the message type in a SOW topic. |
| The name of the SOW topic. By default, unique messages published to this topic will be stored in a topic-specific SOW database. Every SOW requires a method of determining which messages are unique. Several methods are provided within AMPS. See the AMPS User Guide for a discussion on Understanding SOW Keys, and the table below for relevant configuration items. If no |
Required Considerations
A SOW topic must also consider the following options:
Option | Description |
Storage and Recovery | A SOW topic must either specify the |
Record Identity | A SOW topic must define how to determine whether a given message is a distinct record in the topic. Typically, record identity is based on the content of one or more fields in the message content. See Record Identity Definition below for details. |
Memory and File Growth | If the SOW topic will contain a large number or records, or if an individual record will exceed the default allocation size, the topic must define the allocation size. See Memory and File Growth Options below for details. |
Optional Considerations
A SOW topic may also provide the following options (notice, though, that there are restrictions on how some of these options are used with other options.
Option | Description |
Indexing | A SOW topic can declare additional hash indexes or direct AMPS to create memo indexes before a field is queried by an application to improve performance. See Indexing Options below for details. |
Historical Query | A SOW topic can keep message state to allow "point in time" historical queries of current values. Notice that this option is not required for message-by-message replay; recording the topic in a transaction log provides full replay. Instead, this option provides the ability to determine what the current value for a message was at a particular point in time (even if that value was set, and remained unchanged, long before the point in time that is being queried). See Historical Query Options below for details. |
Message Enrichment | A SOW topic can modify the content of messages as they are received from an application. See Message Enrichment Options below for details. |
Recording Multiple Logical Topics in One Physical Topic | A SOW topic can be declared as a regular expression topic, where multiple topic names use the same definition and are stored in the same physical file. This can be useful when converting a system from topic-based routing, or any situation where a set of topics use the same message structure, the same method for determining the key, and each topic has a relatively small set of messages. See Multiple Logical Topics in One Physical Topic for details. |
Storage and Recovery Definition
These options specify the storage for the topic and recovery behavior for the topic if the topic is not durably persisted or if the recovery file is not present.
Element | Description |
| The file where the State of the World (SOW) data will be stored. This element is required for SOW topics with a This element should contain the path and the file name. The path can be either an absolute path or a path relative to the current working directory of the AMPS process. Within this element, the escape Two different topics must not share the same file. Two instances of AMPS must not share the same file. |
| Defines the data durability of a SOW topic.
SOW databases specified as Notice that when the Default: Valid values:
When a value of Synonyms: |
| For SOW topics that are covered by the transaction log, the point from which to recover the SOW if the SOW file is removed, or if the SOW topic has This configuration item allows two values:
Default: |
| Time for how long a record should live in the SOW database for this topic. The expiration time is stored on each message, so changing the expiration time in the configuration file will not affect the expiration of messages currently in the SOW. AMPS accepts interval values for the Expiration, using the interval format described in the AMPS Configuration Guide section on units, or one of the following special values:
Default: |
Record Identity Definition
Each SOW topic must define how AMPS will determine which messages are unique. An application can either have AMPS determine the key by specifying one or more Key
fields, provide a SOW key with the publish
command each time a message is published to AMPS. AMPS also provides the ability to provide a custom SowKey
generator with a plugin module.
See the Understanding SOW Keys section of the AMPS User Guide for a full discussion. The following table lists the available configuration items for specifying how AMPS determines the SowKey
for a message:
Options for Record Identity
Element | Description |
| Specifies an XPath-based identifier within each message that AMPS will use to generate a SOW key, which determines whether a message is unique. This element can be specified multiple times to create a composite key from the combined value of the specified When one or more 60East recommends configuring a AMPS automatically creates a hash index for the set of fields specified in the There is no default for this element. |
| The seed value for For example, if your application has a This option can only be specified when one or more Default: The name of the SOW topic. |
| Specifies the SOW key generator module to use for this topic. When this configuration element is present, AMPS calls the specified module to generate a SOW key for each incoming message. Default: Unset (no SOW key generator module). When there is no SOW key generator module specified, AMPS uses the specified A
|
Memory and File Growth
The SOW topic configuration also specifies how the SOW file is allowed to grow. See the Setting SOW Parameters section in the Operations Best Practices topic of the AMPS User Guide for detailed recommendations. The configuration options for controlling how the file is allocated and how the file grows are listed below:
Element | Description |
| The size of each allocation for the SOW file, as a number of bytes. When AMPS needs more space for the SOW, it requests this amount of space from the operating system. This effectively sets the maximum message size that AMPS guarantees can be stored in the SOW. This size includes headers set by AMPS on the message. 60East recommends setting this value only if you will be storing messages larger than the default If it becomes necessary to tune the Default: Maximum: |
| The number of SOW slabs that AMPS will allocate on startup. Default: Maximum: |
Indexing Options
AMPS automatically creates a memo index for a field within a SOW topic when that field is used (for example, is used in a view or is queried by an application).
In addition, AMPS automatically creates a hash index (the primary key index) for the combination of fields used to define the SOW key. The options in this section allow you to manage index creation for a SOW topic.
Indexing is described in more detail in the Indexing SOW Topics section of the AMPS User Guide.
Element | Description |
| AMPS provides the ability to do fast lookup for SOW records based on specific fields. When one or more The AMPS uses a hash index when a query uses a exact string match for all of the fields in the index. AMPS does not use hash indexes for range queries or regular expressions. AMPS automatically creates a hash index for the set of fields specified in the set of |
| AMPS automatically creates memo index fields as needed. This can include the first time a particular field is used in a query. AMPS supports the ability to create memo indexes for specific fields during startup using the When one or more |
| For SOW topics that will contain a large number of distinct keys, providing an expected key count allows AMPS to pre-size the data structure that holds the key. This can provide a performance improvement for publishers by avoiding cases where AMPS has to resize the data structure. There is no default for this value. When no value is provided, AMPS does not pre-size data structures for the SOW. When provided, the value of this option should be the power of 2 closest to the maximum number of keys the topic is expected to hold. For example, a topic that is expected to hold |
Historical Query Options
A SOW topic can, optionally, maintain the ability to query current values at a specific point in time. To specify this, include a History
element in the topic configuration. The History
element must include the following options:
Element | Description |
| Required when a For a historical SOW, the length of time to store history. For example, when the value is 1w, AMPS will store one week of history for this SOW. Used within the |
| Required when a For a historical SOW, the granularity of the history to store. For many applications, it is not necessary for AMPS to store all of the updates to the SOW. This parameter sets the resolution at which AMPS will save the state of a message. A value of For example, when you set a granularity of Used within the |
Message Enrichment
AMPS can modify a message as it is published to the SOW topic from an application. See State of the World Message Enrichment in the AMPS User Guide for details.
Element | Description |
| When present, specifies the message enrichment to be performed before AMPS determines the SOW key for the message. The |
| When present, specifies the message enrichment to be performed after AMPS determines the SOW key for the message. The |
Multiple Logical Topics in One Physical Topic
AMPS can store the last values for a set of topics that match the same naming pattern and use the same configuration in a single set of SOW data structure and physical SOW file. See Storing Multiple Logical Topics in One Physical Topic in the AMPS User Guide for details.
Element | Description |
| When present, declares that this topic will record multiple logical topics into one physical data structure and file, and specifies the pattern to use to determine if the topic that a message is published to will be captured in this topic. Physical topics that include multiple logical topics have the benefits and limitations described in the AMPS User Guide. There is no default for this element. When this element is present, the Legacy Protocols Note: The legacy header formats do not include support for subscribing to or querying from topics that use this element. |
Last updated