Interface RReliableFanout<V>

Type Parameters:
V - The type of message payload
All Superinterfaces:
RDestroyable, RExpirable, RExpirableAsync, RObject, RObjectAsync, RReliableFanoutAsync<V>

public interface RReliableFanout<V> extends RExpirable, RReliableFanoutAsync<V>, RDestroyable
Reliable fanout implementation that ensures message delivery to subscribed queues.
Author:
Nikita Koksharov
  • Method Details

    • publish

      Message<V> publish(FanoutPublishArgs<V> args)
      Publishes a message to all subscribed queues based on the provided arguments.
      Parameters:
      args - arguments defining the message and publishing parameters
      Returns:
      The published message, or null if the message hasn't been added to all subscribed queues. The message may not be added to a subscribed queue if the queue has size limit and is full, if message size exceeds defined queue message size limit or message rejected due to deduplication.
    • publishMany

      List<Message<V>> publishMany(FanoutPublishArgs<V> args)
      Publishes multiple messages to all subscribed queues based on the provided arguments.
      Parameters:
      args - arguments defining the messages and publishing parameters
      Returns:
      A list containing only messages that were added to at least a single subscribed queue. Messages may not be added to a subscribed queue if the queue has size limit and is full, if message size exceeds defined queue message size limit or message rejected due to deduplication.
    • removeFilter

      void removeFilter(String name)
      Removes a filter for the specified queue name .
      Parameters:
      name - the queue name
    • setFilter

      void setFilter(String name, MessageFilter<V> filter)
      Sets a filter that is applied to all messages published to the queue through this fanout.

      The FanoutFilter object is replicated among all ReliableFanout objects and applied on each of them during message publishing.

      Parameters:
      name - the queue name
      filter - applied to messages
    • isSubscribed

      boolean isSubscribed(String name)
      Checks if a queue with the specified name is subscribed to this fanout.
      Parameters:
      name - the queue name
      Returns:
      true if the queue is subscribed, false otherwise
    • subscribeQueue

      boolean subscribeQueue(String name)
      Subscribes a queue with the specified name to this fanout.
      Parameters:
      name - the queue name
      Returns:
      true if the queue was subscribed, false if queue is already subscribed
    • subscribeQueue

      boolean subscribeQueue(String name, MessageFilter<V> filter)
      Subscribes a queue with the specified name to this fanout with a filter.
      Parameters:
      name - the queue name
      filter - the filter that is applied to all messages published through this fanout
      Returns:
      true if the queue was subscribed, false if queue is already subscribed
    • unsubscribe

      boolean unsubscribe(String name)
      Unsubscribes a queue with the specified name from this fanout.
      Parameters:
      name - the queue name
      Returns:
      true if the queue was unsubscribed, false if the queue isn't subscribed
    • getSubscribers

      List<String> getSubscribers()
      Returns a list of the names of all subscribers to this fanout.
      Returns:
      subscriber names
    • countSubscribers

      int countSubscribers()
      Returns amount of subscribers to this fanout.
      Returns:
      amount of subscribers