Interface ITopic
The ITopic interface facilitates creating subscription and publishing of messages against the topic. This also provides event registrations for message delivery failure, receiving messages and deleting topics.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public interface ITopic : IDisposable
Properties
Name | Description |
---|---|
ExpirationTime | Default Expiry time of messsage for this topic. Its default value is TimeSpan.MaxValue. |
IsClosed | Is topic closed or not? |
MessageCount | Number of messages published for this topic. |
Name | Topic's name |
OnTopicDeleted | Topic deletion events are delivered through this callback. |
SearchOptions | Returns whether user has subscribed to Pattern based or simple subscription |
Methods
Name | Description |
---|---|
CreateDurableSubscription(String, SubscriptionPolicy, MessageReceivedCallback, Nullable<TimeSpan>) | Creates a Durable subscription |
CreateSubscription(MessageReceivedCallback) | This method is used to register against topic on cache if topic exists, otherwise throw exception. |
Publish(Message, DeliveryOption, Boolean) | This method is used to Publish the message in the cache with specified DeliveryOption. And the option to notify the publisher if the message has failed to deliver because of expiration, eviction or internal system issue. |
PublishAsync(Message, DeliveryOption, Boolean) | This method is used to Publish a message asynchronously in the cache with specified DeliveryOption and the option to notify the publisher if the message has failed to deliver because of expiration, eviction or internal system issue. |
PublishBulk(IEnumerable<Tuple<Message, DeliveryOption>>, Boolean) | This method is used to Publish messages in bulk in the cache with specified DeliveryOption. And the option to notify the publisher if the message has failed to deliver because of expiration, eviction or internal system issue. |
Events
Name | Description |
---|---|
MessageDeliveryFailure | Subscribe for Message delivery failure events |