SOW/ConflatedTopic

AMPS provides the ability to create ongoing snapshots of a SOW topic, called conflated topics (also called topic replicas in previous releases of AMPS). Conflated topics are updated on an interval, and store a snapshot of the current state of the world at each interval. This helps to manage bandwidth to clients that do not act on each update, such as a client UI that refreshes every second rather than with every update.

For compatibility with previous AMPS versions, AMPS allows you to use ReplicaDefinition as a synonym for ConflatedTopic.

ElementDescription

Name (required)

String used to define the name of the conflated topic. While AMPS doesn't enforce naming conventions, it can be convenient to name the conflated topic based on the underlying topic name. For example, if the underlying topic is orders, it can be convenient to name the conflated topic orders-C.

If no Name is provided, AMPS accepts Topic as a synonym for Name to provide compatibility with versions of AMPS previous to 5.0.

UnderlyingTopic (required)

String used to define the SOW topic which provides updates to the conflated topic. This must exactly match the name of a SOW topic.

When the underlying topic is a regular expression topic, this must match the Name of the topic rather than the Pattern of the topic. In this case, the conflated topic will conflate all of the topics in the underlying regular expression topic into individual topics. The names of the individual topics are set using the TopicFormat element in this case.

MessageType (required)

The message format of the underlying topic.

This MessageType must be the MessageType of the provided UnderlyingTopic.

Interval

The frequency at which AMPS updates the data in the conflated topic.

Default: 5s

Minimum: 100ms

Filter

Content filter that is applied to the underlying topic.

Only messages that match the content filter are stored in the conflated topic.

HashIndex

AMPS provides the ability to do fast lookup for SOW records based on specific fields.

When one or more HashIndex elements are provided, AMPS creates a hash index for the fields specified in the element. These indexes are created on startup, and are kept up to date as records are added, removed, and updated.

The HashIndex element contains a Key element for each field in the hash index.

AMPS uses a hash index when a query uses exact matching 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 Key fields for the UnderlyingTopic, if that topic provides Key fields.

If the underlying topic of a ConflatedTopic is a set of logical topics defined with the Pattern element, an additional configuration parameter is required to specify the topic name that AMPS will use for each conflated topic.

ElementDescription

TopicFormat (required if the underlying topic uses a Pattern)

String used to format the name of the conflated topics when the underlying topic is uses a Pattern to create a group of logical topics within a single physical topic.

When the underlying topic is a regular expression topic, AMPS will create a conflated topic for each topic within the regular expression topic. This element specifies how AMPS will construct the name of the conflated topics produced.

The TopicFormat must contain the string %n, which is replaced with the name of the topic in the underlying regular expression topic.

For example, if the TopicFormat is %n-C, when the underlying regular expression topic contains a topic named /my/orders, AMPS will produce a conflated topic with the name /my/orders-C.

There is no default for this element. This element cannot contain characters that are significant for regular expressions (such as ., ^, and so on).

<ConflatedTopic>
    <Topic>FastPublishTopic-C</Topic>
    <MessageType>nvfix</MessageType>
    <UnderlyingTopic>FastPublishTopic</UnderlyingTopic>
    <Interval>5s</Interval>
    <Filter>/region = 'A'</Filter>
</ConflatedTopic>
<ConflatedTopic>
    <Topic>LongIntervalTopic-C</Topic>
    <MessageType>json</MessageType>
    <UnderlyingTopic>FastPublishTopic</UnderlyingTopic>
    <Interval>120s</Interval>
    <HashIndex>
       <Key>/order/status</Key>
    </HashIndex>
</ConflatedTopic>
<ConflatedTopic>
   <Topic>ConflateUnderlyingRegex</Topic>
   <MessageType>bflat</MessageType>
   <UnderlyingTopic>TheRegexTopic</UnderlyingTopic>
   <Interval>20s</Interval>
</ConflatedTopic>

Last updated

Copyright 2013-2024 60East Technologies, Inc.