Interface RReliableTopic

    • Method Detail

      • size

        long size()
        Amount of messages stored in Redis Stream object.
        Returns:
        amount of messages
      • publish

        long publish​(Object message)
        Publish the message to all subscribers of this topic asynchronously. Each subscriber may have multiple listeners.
        Parameters:
        message - to send
        Returns:
        number of subscribers that received the message
      • addListener

        <M> String addListener​(Class<M> type,
                               MessageListener<M> listener)
        Subscribes to this topic. MessageListener.onMessage method is called when any message is published on this topic.

        Watchdog is started when listener was registered.

        Type Parameters:
        M - - type of message
        Parameters:
        type - - type of message
        listener - for messages
        Returns:
        locally unique listener id
        See Also:
        Config.setReliableTopicWatchdogTimeout(long), MessageListener
      • removeListener

        void removeListener​(String... listenerIds)
        Removes the listener by id for listening this topic
        Parameters:
        listenerIds - - listener ids
      • removeAllListeners

        void removeAllListeners()
        Removes all listeners from this topic
      • countListeners

        int countListeners()
        Returns amount of registered listeners to this topic
        Returns:
        amount of listeners
      • countSubscribers

        int countSubscribers()
        Returns amount of subscribers to this topic across all Redisson instances. Each subscriber may have multiple listeners.
        Returns:
        amount of subscribers