How does AMPS construct the SowKey for a message?
AMPS constructs the SowKey for the message from the contents of the defined Key fields for the topic and the KeyDomain for the topic (which is the name of the SOW topic by default).
Here's an example of how it works. If a Topic "foo" has Key fields /a and /b defined, then an individual message's SowKey is defined as
CRC(DOMAIN("foo") + special + VALUE("/a") + special + VALUE("/b"))
DOMAINreturns theSowKey"domain" for the topic. By default, this is the topic's name. If the configuration for the topic specifies aKeyDomain, then this function returns theKeyDomain.VALUEis the value the message contains at that path special a special delimiter CRC Checksum computed over the constructed string
info
- If there's no entry for the topic in the configuration file (that is, there's no SOW configured), AMPS doesn't produce a
SowKeyfor the message. - When
KeyDomainisn't explicitly set, identical messages to different topics produce differentSowKeys. - When
KeyDomainis set, you can use theSowKeyto correlate messages published to different topics (provided the topics use the same key fields).