Method CreateTopic
CreateTopic(String)
Creates and retrieves the topic instance against the specified topic name.
Declaration
ITopic CreateTopic(string topicName)
Parameters
Type | Name | Description |
---|---|---|
System.String | topicName | Name to identify the topic. |
Returns
Type | Description |
---|---|
ITopic | Returns the created topic instance. |
Examples
The following example demonstrates how to create a topic.
First initialize cache.
ICache cache = CacheManager.GetCache("demoCache");
Then get messaging service from cache.
IMessagingService messagingService=cache.MessagingService;
Then create topic from messagingService
ITopic topic=messagingService.CreateTopic("mytopic");