Class StreamConfigBuilder

  • All Implemented Interfaces:

    
    public final class StreamConfigBuilder
    
                        

    Builder for JetStream stream configuration

    • Constructor Detail

      • StreamConfigBuilder

        StreamConfigBuilder()
    • Method Detail

      • getSubjects

         final List<String> getSubjects()

        List of subjects this stream listens to

        Supports wildcards (e.g., "orders.*", "payments.>"). May be empty when the stream is a mirror or aggregates from source streams - a stream fed only by other streams has no subjects of its own.

      • setSubjects

         final Unit setSubjects(List<String> <set-?>)

        List of subjects this stream listens to

        Supports wildcards (e.g., "orders.*", "payments.>"). May be empty when the stream is a mirror or aggregates from source streams - a stream fed only by other streams has no subjects of its own.

      • getMaxConsumers

         final Integer getMaxConsumers()

        Maximum number of consumers allowed on this stream (-1 for unlimited)

      • setMaxConsumers

         final Unit setMaxConsumers(Integer <set-?>)

        Maximum number of consumers allowed on this stream (-1 for unlimited)

      • getMaxMessages

         final Long getMaxMessages()

        Maximum number of messages to retain (-1 for unlimited)

      • setMaxMessages

         final Unit setMaxMessages(Long <set-?>)

        Maximum number of messages to retain (-1 for unlimited)

      • getMaxBytes

         final Long getMaxBytes()

        Maximum total bytes to retain (-1 for unlimited)

      • setMaxBytes

         final Unit setMaxBytes(Long <set-?>)

        Maximum total bytes to retain (-1 for unlimited)

      • getMaxAge

         final Duration getMaxAge()

        Maximum age of messages to retain (Duration.ZERO for unlimited)

      • setMaxAge

         final Unit setMaxAge(Duration <set-?>)

        Maximum age of messages to retain (Duration.ZERO for unlimited)

      • getNoAck

         final Boolean getNoAck()

        Disable acknowledgments (used for fire-and-forget scenarios)

      • setNoAck

         final Unit setNoAck(Boolean <set-?>)

        Disable acknowledgments (used for fire-and-forget scenarios)

      • getAllowDirect

         final Boolean getAllowDirect()

        Serve reads straight from the stream, without a consumer

        What makes getMessage-shaped lookups and a mirror's local reads a single round trip rather than a consumer created and torn down per call.

      • setAllowDirect

         final Unit setAllowDirect(Boolean <set-?>)

        Serve reads straight from the stream, without a consumer

        What makes getMessage-shaped lookups and a mirror's local reads a single round trip rather than a consumer created and torn down per call.

      • raw

         final Unit raw(Function1<StreamConfiguration.Builder, Unit> customize)

        Reach a jnats stream setting this DSL does not model

        StreamConfiguration.Builder carries more than natsy has an opinion about; subjectTransform, consumerLimits, allowRollup, mirrorDirect, firstSequence and metadata are all reachable here rather than being unreachable until natsy grows a property for each.

        Applied last, after everything else this block sets, so it can also override those. Blocks accumulate, and they apply on the update path too - a raw { } in a stream { } block that finds the stream already there is part of the patch, exactly like an assigned property.

        raw {
            subjectTransform(SubjectTransform.builder().source("orders.>").destination("all.>").build())
        }