Topic Addresses

Topics classify the information contained in the payload of each event instance. Events are published to a topic and consumers subscribe to topics to attract all events for that topic. When you create an event in Designer, you define a topic address for each event. At runtime, when an application publishes instances of an event, the topic address is used to construct the topic for each instance. For more information, about how topics work, see Understanding Topics.

Before you start defining topic addresses, it's best practice to define the overall topic hierarchy for your EDA. For more information, see Topic Architecture Best Practices.

Defining Topic Addresses for Events

A topic address is expressed as a series of hierarchical topic address levels. Each topic address level can be a literal value or variable. A variable is a placeholder that is substituted with a concrete value by publishing applications at runtime.

The topic addresses for events published to Solace event brokers use a forward slash / as a delimiter to separate levels. Kafka brokers don't natively support topic hierarchies; however, to support organizing your EDA, you can use topic hierarchies if you specify a character to act as a delimiter to represent level divisions in your Kafka topics.

Topic Domains

Each application domain can have one or more topic domains. The topic domain can include one or more topic address levels. It's best practice for each application domain to have unique topic domains that represent the top levels of your topic hierarchy for events within the application domain. You can require new events to use topic addresses that start with one of the a topic domains of the application domain .

Using Variables in Topic Domains and Topic Addresses

When you add a topic domain to an application domain or a topic address to an event, each level can be specified by a literal value or by a variable. A variable is a placeholder that is replaced with a concrete value by the publishing application at runtime. Use a literal value when you want a topic address level to be the same for all instances of an event. You use a variable when you want the topic level to classify an event by a value specific to the event instance. For example, if an event is generated when a flight departs, a variable for the flight number could be one level of the topic address. When an application generates an event instance for a flight departure, the variable in the topic address is replaced with the flight number in the topic of the event instance. Other applications can then subscribe only to event instances for specific flights.

Variables can be unbounded or you can limit a variable to a list of options using enumerations. Enumerations are a type of topic address level variable that define a bounded list of acceptable values. If you use an enumeration for a variable, only values that are part of the enumeration can replace the variable in the topic at runtime. For example, if an event instance could occur in any of six possible locations and you want the topic to include the location, you could create an enumeration that includes the six options. For more information, see Enumerations.

Defining Kafka Topic Addresses

When defining Kafka topic addresses or subscriptions, be aware of the following:

  • Kafka topic addresses don't support enumerations.

  • Kafka topic subscriptions don't support wildcards.

  • Kafka brokers don't recognize level delimiters in topics. If you want to include Kafka events in your EDA, you can specify a delimiter that Event Portal recognizes in Kafka topics. All Kafka topic addresses in your organization's account must use the same delimiter. For more information, see Setting the Kafka Delimiter.

Topic Address Syntax

Topic addresses have a few syntax rules and best practices. Some rules are enforced in Designer.

  • Topic addresses can't exceed 128 levels.

  • Topic addresses can't include empty levels. All delimiters must have text or a variable between them.

  • Topic addresses can't exceed 255 characters.

  • Topic address level variables must start with a letter or underscore and must contain only alphanumeric, hyphen, and underscore characters.

  • For Solace topic addresses, don't use /, *, >, or ! within a topic address level. These characters have special meaning. For more information about topic syntax, see Solace Message Format Topics.

Topic Subscriptions

A topic subscription is a string that consumers use to attract the events published to a topic. In Event Portal, you set topic subscriptions in the consumers you add to applications. Unlike topic addresses, topic subscriptions can contain wildcards to match with multiple topics. The * and > characters can be used as wildcards in topic subscriptions.

  • *
  • When * appears by itself at a level within a topic subscription, it indicates a wildcard match at that level. For example, flight/*/ea1234 matches the topics flight/boarding/ea1234 and flight/departed/ea1234.

  • >
  • The > character is used at the last level of a subscription to indicate a “one or more” wildcard match. For example, flight/boarding/> doesn't match the topic flight/boarding, but it does match flight/boarding/ea1234 and flight/boarding/ea321/yow/fra.

To learn more about wildcard rules and their use in topic subscriptions, see Wildcard Characters in Topic Subscriptions.