Creating Topics
When using the Solace JavaScript API, a client creates a generic Destination instance (instead of a topic instance like other Solace Messaging APIs) to encapsulate a topic name that can be used as a destination to publish messages to. The Destination instance is used by consumers to indicate through subscriptions what messages they are interested in receiving.
When using the Solace JavaScript API and Solace Node.js API, a generic Destination instance is created and used instead of a topic instance.
Clients can create:
- Non-temporary topics at the factory level.
- Temporary topics at the session level. The scope and lifetime of a temporary topic is that of the session it is created in.
For information on the supported topic syntax rules, refer to Topic Support & Syntax.
Topics
You can create a topic (non-temporary), call solace.SolClientFactory.createTopicDestination(...) on a connected session and pass in a topic name.