Subjects are the core building blocks of Kafkorama's real-time Streaming APIs.
Kafkorama is a messaging system based on a subject-oriented publish/subscribe model.
In Kafkorama, subjects themselves are the Streaming API endpoints. Applications subscribe to a subject to receive messages published to it, or publish messages to a subject to make them available to subscribers.
A subject is a UTF-8 string similar in syntax to Unix absolute paths. It must begin with a slash (/) and consist of one or more non-empty segments separated by slashes.
For example, /Stocks/NYSE/IBM is a valid subject, composed of the segments Stocks, NYSE, and IBM.
Below are examples of invalid subjects and the reasons they are not allowed:
| Invalid Subject | Reason |
|---|---|
/Stocks//IBM/BID |
The second segment is empty |
Stocks/IBM/BID |
It does not start with a slash (/) |
/Stocks/IBM/BID/ |
The last segment is empty |
For details about how Kafkorama subjects automatically map to Kafka topics, see the section
Subjects ↔ Kafka Topics.