Technical Details
Technical Details
Publish and subscribe messaging uses the following classes in the EnsLib.PubSub package:
| Class Name | Purpose | 
|---|---|
| EnsLib.PubSub.PubSubOperationOpens in a new tab | Business operation that provides publish and subscribe message routing. | 
| EnsLib.PubSub.RequestOpens in a new tab | Request class that packages requests to the PubSubOperation class. Specifies which topic and DomainName should be used to determine how the message should be routed. Optionally, the Request may also contain the message being routed, but the PubSubOperation does not need this information to return its TargetList. | 
| EnsLib.PubSub.ResponseOpens in a new tab | Response class that packages responses from the PubSubOperation class. Contains a collection of Target objects called TargetList, which the calling business process consults before dispatching the message to the required destinations. | 
| EnsLib.PubSub.SubscriberOpens in a new tab | Persistent class that represents individual subscribers. These are entities interested in being notified when certain messages arrive. The Subscriber class includes any information needed to contact the actual subscriber. | 
| EnsLib.PubSub.SubscriptionOpens in a new tab | Persistent class that stores the association between a given Subscriber and a topic string. | 
| EnsLib.PubSub.DomainNameOpens in a new tab | Persistent class that holds the set of PubSub domain names. Domain names are optional; like namespaces, domains provide a way to keep different subscription lists separate. | 
| EnsLib.PubSub.UtilsOpens in a new tab | Utility class that provides a programmatic API for creating and deleting domains, subscribers, and subscriptions. | 
| EnsLib.PubSub.TargetOpens in a new tab | Persistent class that provides details about how to route a message to a destination outside a production. The Target object has a Target property that identifies a configured business process or business operation within the current production. The Target object has an optional Address property that can specify an external address, for example an email address. | 
Instead of using the Management Portal, you can manipulate the objects directly using methods in the EnsLib.PubSub.UtilsOpens in a new tab class.
EnsLib.PubSub.PubSubOperationOpens in a new tab does not actually send messages to subscribers; instead, it provides a mechanism to quickly find the set of interested subscribers for a given topic. It is the responsibility of a business process that calls the PubSubOperation to dispatch messages to subscribers.
At runtime, an incoming message is sent to a business process, which examines it for identifying details. Based on this analysis, the business process assigns the message a specific topic string that does not contain any wildcard characters. It then creates an EnsLib.PubSub.RequestOpens in a new tab message that contains this topic string and sends it to the PubSubOperation.
The PubSubOperation uses an extremely fast search algorithm to find and return a list of all subscribers interested in this topic. The PubSubOperation returns an EnsLib.PubSub.ResponseOpens in a new tab message that contains a collection of EnsLib.PubSub.TargetOpens in a new tab objects called TargetList. The business process iterates over this collection to dispatch the message to each EnsLib.PubSub.TargetOpens in a new tab in the collection.