Interface StreamCreator


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

    • MAX_SEGMENT_SIZE

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

    • stream

      StreamCreator stream(String stream)
      The name of the stream.

      Alias for name(String).

      Parameters:
      stream -
      Returns:
      this creator instance
    • 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
    • leaderLocator

      StreamCreator leaderLocator(StreamCreator.LeaderLocator leaderLocator)
      Parameters:
      leaderLocator -
      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:
    • 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:
    • 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

      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.