Interface RReliableFanoutRx<V>

Type Parameters:
V - The type of message payload
All Superinterfaces:
RDestroyable, RExpirableRx, RObjectRx

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

    • publish

      io.reactivex.rxjava3.core.Maybe<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Completable removeFilter(String name)
      Removes a filter for the specified queue name .
      Parameters:
      name - the queue name
    • setFilter

      io.reactivex.rxjava3.core.Completable 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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

      io.reactivex.rxjava3.core.Single<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

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

      io.reactivex.rxjava3.core.Single<Integer> countSubscribers()
      Returns amount of subscribers to this fanout.
      Returns:
      amount of subscribers