Method CreateTopic
CreateTopic(String)
Retrieves the specified topic instance.
Declaration
ITopic CreateTopic(string topicName)
Parameters
Type | Name | Description |
---|---|---|
System.String | topicName | Name or pattern to identify topic. |
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",TopicMode.Normal /TopicMode.Pattern);
Then get messaging service from cache.
IMessagingService messagingService=cache.MessagingService;
Then get topic from messagingService
ITopic topic=messagingService.GetTopic("mytopic",TopicSearchOption);
TopicSearch Option is an optional paramater which has default value of ByName