Class StreamConfig
-
- All Implemented Interfaces:
public final class StreamConfigDSL for configuring JetStream streams
Example usage:
val streamCtx = js.stream("MY_STREAM") { subjects = listOf("orders.*", "payments.*") retentionPolicy = RetentionPolicy.LIMITS maxMessages = 1000000 maxBytes = 1024 * 1024 * 1024 // 1GB storageType = StorageType.FILE replicas = 3 }
-
-
Field Summary
Fields Modifier and Type Field Description private final List<String>subjectsprivate final RetentionPolicyretentionPolicyprivate final IntegermaxConsumersprivate final LongmaxMessagesprivate final LongmaxBytesprivate final DurationmaxAgeprivate final IntegermaxMsgSizeprivate final StorageTypestorageTypeprivate final Integerreplicasprivate final BooleannoAckprivate final DurationduplicateWindowprivate final DiscardPolicydiscardPolicyprivate final Stringdescriptionprivate final Placementplacementprivate final StreamSourcemirrorprivate final List<StreamSource>sourcesprivate final LongmaxMessagesPerSubject
-
Method Summary
Modifier and Type Method Description final List<String>getSubjects()List of subjects this stream listens to Supports wildcards (e.g., "orders.*", "payments.>") final RetentionPolicygetRetentionPolicy()Retention policy for the stream final IntegergetMaxConsumers()Maximum number of consumers allowed on this stream (-1 for unlimited) final LonggetMaxMessages()Maximum number of messages to retain (-1 for unlimited) final LonggetMaxBytes()Maximum total bytes to retain (-1 for unlimited) final DurationgetMaxAge()Maximum age of messages to retain (Duration. final IntegergetMaxMsgSize()Maximum size of a single message (-1 for unlimited) final StorageTypegetStorageType()Storage type for the stream final IntegergetReplicas()Number of replicas for the stream (1-5) final BooleangetNoAck()Disable acknowledgments (used for fire-and-forget scenarios) final DurationgetDuplicateWindow()Window within which to track duplicate messages final DiscardPolicygetDiscardPolicy()Discard policy when limits are reached final StringgetDescription()Description of the stream final PlacementgetPlacement()Placement configuration for clustering final StreamSourcegetMirror()Mirror configuration to mirror another stream final List<StreamSource>getSources()List of sources to aggregate from multiple streams final LonggetMaxMessagesPerSubject()Maximum messages per subject (-1 for unlimited) -
-
Method Detail
-
getSubjects
final List<String> getSubjects()
List of subjects this stream listens to Supports wildcards (e.g., "orders.*", "payments.>")
-
getRetentionPolicy
final RetentionPolicy getRetentionPolicy()
Retention policy for the stream
-
getMaxConsumers
final Integer getMaxConsumers()
Maximum number of consumers allowed on this stream (-1 for unlimited)
-
getMaxMessages
final Long getMaxMessages()
Maximum number of messages to retain (-1 for unlimited)
-
getMaxBytes
final Long getMaxBytes()
Maximum total bytes to retain (-1 for unlimited)
-
getMaxAge
final Duration getMaxAge()
Maximum age of messages to retain (Duration.ZERO for unlimited)
-
getMaxMsgSize
final Integer getMaxMsgSize()
Maximum size of a single message (-1 for unlimited)
-
getStorageType
final StorageType getStorageType()
Storage type for the stream
-
getReplicas
final Integer getReplicas()
Number of replicas for the stream (1-5)
-
getDuplicateWindow
final Duration getDuplicateWindow()
Window within which to track duplicate messages
-
getDiscardPolicy
final DiscardPolicy getDiscardPolicy()
Discard policy when limits are reached
-
getDescription
final String getDescription()
Description of the stream
-
getPlacement
final Placement getPlacement()
Placement configuration for clustering
-
getMirror
final StreamSource getMirror()
Mirror configuration to mirror another stream
-
getSources
final List<StreamSource> getSources()
List of sources to aggregate from multiple streams
-
getMaxMessagesPerSubject
final Long getMaxMessagesPerSubject()
Maximum messages per subject (-1 for unlimited)
-
-
-
-