public static class StreamConfiguration.Builder
extends java.lang.Object
new StreamConfiguration.Builder().build()
will create a new StreamConfiguration.
Constructor and Description |
---|
Builder()
Default Builder
|
Builder(StreamConfiguration sc)
Update Builder, useful if you need to update a configuration
|
Modifier and Type | Method and Description |
---|---|
StreamConfiguration.Builder |
addSources(java.util.Collection<Source> sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
addSources(Source... sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
addSubjects(java.util.Collection<java.lang.String> subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration.Builder |
addSubjects(java.lang.String... subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration |
build()
Builds the StreamConfiguration
|
StreamConfiguration.Builder |
description(java.lang.String description)
Sets the description
|
StreamConfiguration.Builder |
discardPolicy(DiscardPolicy policy)
Sets the discard policy in the StreamConfiguration.
|
StreamConfiguration.Builder |
duplicateWindow(java.time.Duration window)
Sets the duplicate checking window in the the StreamConfiguration.
|
StreamConfiguration.Builder |
duplicateWindow(long windowMillis)
Sets the duplicate checking window in the the StreamConfiguration.
|
StreamConfiguration.Builder |
maxAge(java.time.Duration maxAge)
Sets the maximum age in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxAge(long maxAgeMillis)
Sets the maximum age in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxBytes(long maxBytes)
Sets the maximum number of bytes in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxConsumers(long maxConsumers)
Sets the maximum number of consumers in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMessages(long maxMsgs)
Sets the maximum number of messages in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMessagesPerSubject(long maxMsgsPerSubject)
Sets the maximum number of message per subject in the StreamConfiguration.
|
StreamConfiguration.Builder |
maxMsgSize(long maxMsgSize)
Sets the maximum message size in the StreamConfiguration.
|
StreamConfiguration.Builder |
mirror(Mirror mirror)
Sets the mirror object
|
StreamConfiguration.Builder |
name(java.lang.String name)
Sets the name of the stream.
|
StreamConfiguration.Builder |
noAck(boolean noAck)
Sets the acknowledgement mode of the StreamConfiguration.
|
StreamConfiguration.Builder |
placement(Placement placement)
Sets the placement directive object
|
StreamConfiguration.Builder |
replicas(int replicas)
Sets the number of replicas a message must be stored on in the StreamConfiguration.
|
StreamConfiguration.Builder |
retentionPolicy(RetentionPolicy policy)
Sets the retention policy in the StreamConfiguration.
|
StreamConfiguration.Builder |
sources(java.util.Collection<Source> sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
sources(Source... sources)
Sets the sources in the StreamConfiguration.
|
StreamConfiguration.Builder |
storageType(StorageType storageType)
Sets the storage type in the StreamConfiguration.
|
StreamConfiguration.Builder |
subjects(java.util.Collection<java.lang.String> subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration.Builder |
subjects(java.lang.String... subjects)
Sets the subjects in the StreamConfiguration.
|
StreamConfiguration.Builder |
templateOwner(java.lang.String templateOwner)
Sets the template a stream in the form of raw JSON.
|
public Builder()
public Builder(StreamConfiguration sc)
sc
- the configuration to copypublic StreamConfiguration.Builder name(java.lang.String name)
name
- name of the stream.public StreamConfiguration.Builder description(java.lang.String description)
description
- the descriptionpublic StreamConfiguration.Builder subjects(java.lang.String... subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder subjects(java.util.Collection<java.lang.String> subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder addSubjects(java.lang.String... subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder addSubjects(java.util.Collection<java.lang.String> subjects)
subjects
- the stream's subjectspublic StreamConfiguration.Builder retentionPolicy(RetentionPolicy policy)
policy
- the retention policy of the StreamConfigurationpublic StreamConfiguration.Builder maxConsumers(long maxConsumers)
maxConsumers
- the maximum number of consumerspublic StreamConfiguration.Builder maxMessages(long maxMsgs)
maxMsgs
- the maximum number of messagespublic StreamConfiguration.Builder maxMessagesPerSubject(long maxMsgsPerSubject)
maxMsgsPerSubject
- the maximum number of messagespublic StreamConfiguration.Builder maxBytes(long maxBytes)
maxBytes
- the maximum number of bytespublic StreamConfiguration.Builder maxAge(java.time.Duration maxAge)
maxAge
- the maximum message agepublic StreamConfiguration.Builder maxAge(long maxAgeMillis)
maxAgeMillis
- the maximum message agepublic StreamConfiguration.Builder maxMsgSize(long maxMsgSize)
maxMsgSize
- the maximum message sizepublic StreamConfiguration.Builder storageType(StorageType storageType)
storageType
- the storage typepublic StreamConfiguration.Builder replicas(int replicas)
replicas
- the number of replicas to store this message onpublic StreamConfiguration.Builder noAck(boolean noAck)
noAck
- true to disable acknowledgements.public StreamConfiguration.Builder templateOwner(java.lang.String templateOwner)
templateOwner
- the stream template of the stream.public StreamConfiguration.Builder discardPolicy(DiscardPolicy policy)
policy
- the discard policy of the StreamConfigurationpublic StreamConfiguration.Builder duplicateWindow(java.time.Duration window)
window
- duration to hold message ids for duplicate checking.public StreamConfiguration.Builder duplicateWindow(long windowMillis)
windowMillis
- duration to hold message ids for duplicate checking.public StreamConfiguration.Builder placement(Placement placement)
placement
- the placement directive objectpublic StreamConfiguration.Builder mirror(Mirror mirror)
mirror
- the mirror objectpublic StreamConfiguration.Builder sources(Source... sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder sources(java.util.Collection<Source> sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder addSources(Source... sources)
sources
- the stream's sourcespublic StreamConfiguration.Builder addSources(java.util.Collection<Source> sources)
sources
- the stream's sourcespublic StreamConfiguration build()