Method GetTopic
GetTopic(String)
Retrieves the specified topic instance.
Declaration
ITopic GetTopic(string topicName)
Parameters
Type | Name | Description |
---|---|---|
System.String | topicName |
Returns
Type | Description |
---|---|
ITopic | Returns the topic instance, null if it does not exist. |
Examples
The following example demonstrates how to get a topic.
First initialize cache.
Cache cache = NCache.InitializeCache("myCache");
Then get messaging service from cache.
IMessagingService messagingService=cache.MessagingService;
Then get topic from messagingService
ITopic topic=messagingService.GetTopic("mytopic");