Package com.rabbitmq.stream
Interface StreamCreator
-
public interface StreamCreator
API to configure and create a stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
StreamCreator.LeaderLocator
The leader locator strategy.static interface
StreamCreator.SuperStreamConfiguration
Super stream configuration.
-
Field Summary
Fields Modifier and Type Field Description static ByteCapacity
MAX_SEGMENT_SIZE
Segment size is limited to 3 GB.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StreamCreator
argument(String key, String value)
Set an argument for the stream creation.void
create()
Create the stream.StreamCreator
filterSize(int size)
Set the size of the stream chunk filters.StreamCreator
initialMemberCount(int initialMemberCount)
Set the number of initial members the stream should have.StreamCreator
leaderLocator(StreamCreator.LeaderLocator leaderLocator)
TheStreamCreator.LeaderLocator
strategy.StreamCreator
maxAge(Duration maxAge)
The maximum age of a stream before it gets truncated.StreamCreator
maxLengthBytes(ByteCapacity byteCapacity)
The maximum size of the stream before it gets truncated.StreamCreator
maxSegmentSizeBytes(ByteCapacity byteCapacity)
The maximum size of each stream segments.StreamCreator
name(String name)
The name of the (super) stream.StreamCreator
stream(String stream)
The name of the stream.StreamCreator.SuperStreamConfiguration
superStream()
Configure the super stream to create.
-
-
-
Field Detail
-
MAX_SEGMENT_SIZE
static final ByteCapacity MAX_SEGMENT_SIZE
Segment size is limited to 3 GB.
-
-
Method Detail
-
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)
TheStreamCreator.LeaderLocator
strategy.- 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:
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 keyvalue
- 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.
-
-