Interface TopicSubscription

  • All Known Subinterfaces:
    DurableTopicSubscription

    public interface TopicSubscription
    NCache provides TopicSubscription interface which is returned against the desired topic, containing information for topic subscriptions.
    • Method Detail

      • getTopic

        Topic getTopic()
        Retrieves the topic instance containing information about the topic.
        Returns:
        Topic instance of the topic, null if it does not exist.
      • addMessageReceivedListener

        void addMessageReceivedListener​(MessageReceivedListener messageReceivedListener)
                                 throws CacheException
        Event to register subscriber against the topic so that it can receive the published messages.
        Parameters:
        messageReceivedListener - The listener that is invoked whenever a message is received.
        Throws:
        CacheException
      • removeMessageReceivedListener

        void removeMessageReceivedListener​(MessageReceivedListener messageReceivedListener)
                                    throws CacheException
        Unregisters the user for message received event.
        Parameters:
        messageReceivedListener - The instance of the registerd message received listener.
        Throws:
        CacheException
      • unSubscribe

        void unSubscribe()
                  throws java.lang.Exception
        This method unsubscribes the topic.
        Throws:
        java.lang.Exception