Interface StreamCreator


  • public interface StreamCreator
    API to configure and create a stream.
    • Field Detail

      • MAX_SEGMENT_SIZE

        static final ByteCapacity MAX_SEGMENT_SIZE
        Segment size is limited to 3 GB.
    • Method Detail

      • name

        StreamCreator name​(String name)
        The name of the (super) stream.
        Parameters:
        name -
        Returns:
        this creator instance
        Since:
        0.15.0
      • maxLengthBytes

        StreamCreator maxLengthBytes​(ByteCapacity byteCapacity)
        The maximum size of the stream before it gets truncated.
        Parameters:
        byteCapacity -
        Returns:
        this creator instance
      • maxSegmentSizeBytes

        StreamCreator maxSegmentSizeBytes​(ByteCapacity byteCapacity)
        The maximum size of each stream segments.

        Maximum size is MAX_SEGMENT_SIZE (3 GB).

        Parameters:
        byteCapacity -
        Returns:
        this creator instance
      • maxAge

        StreamCreator maxAge​(Duration maxAge)
        The maximum age of a stream before it gets truncated.
        Parameters:
        maxAge -
        Returns:
        this creator instance
      • filterSize

        StreamCreator filterSize​(int size)
        Set the size of the stream chunk filters.

        Must be between 16 and 255 bytes, default is 16.

        Use a bloom filter calculator to size the filter accordingly to the possible number of filter values and the acceptable rate of false positives (RabbitMQ Stream uses 2 hash functions).

        Parameters:
        size - (in bytes)
        Returns:
        this creator instance
        See Also:
        ProducerBuilder.filterValue(Function), ConsumerBuilder.filter()
      • initialMemberCount

        StreamCreator initialMemberCount​(int initialMemberCount)
        Set the number of initial members the stream should have.
        Parameters:
        initialMemberCount - initial number of nodes
        Returns:
        this creator instance
        See Also:
        Initial Replication Factor
      • argument

        StreamCreator argument​(String key,
                               String value)
        Set an argument for the stream creation.
        Parameters:
        key - argument key
        value - argument value
        Returns:
        this creator instance
      • superStream

        StreamCreator.SuperStreamConfiguration superStream()
        Configure the super stream to create.

        Requires RabbitMQ 3.13.0 or more.

        Returns:
        the super stream configuration
        Since:
        0.15.0
      • create

        void create()
        Create the stream.

        This method is idempotent: the stream exists when it returns.