A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
R
S
T
U
V
W
C
- close() - function in eu.vstoyanov.natsy.NatsKlient
- Cancel everything running on scope and close the connection immediatelycloseGracefully is the graceful counterpart: it drains first, so nothing in flight is lost.
- closeBlocking(kotlin.time.Duration) - function in eu.vstoyanov.natsy.NatsKlient
- closeGracefully for callers that cannot suspendBlocks the calling thread for up to timeout on the drain.
- closeGracefully(kotlin.time.Duration) - function in eu.vstoyanov.natsy.NatsKlient
- Drain, then close: the complete shutdown sequence in one calldrain delivers what is already in flight and closes the connection; close then cancels scope and releases its dispatchers.
- codecFor(kotlin.reflect.KClass) - function in eu.vstoyanov.natsy.codec.CodecRegistry
- Codec registered for type, or
nullwhen the type has noneLookup is exact, and deliberately has no fallback:MessageCodec<T>is erased, so a codec for some other type would pass every cast the compiler can write here and be handed back as aMessageCodec<T>that encodes and decodes something else entirely - aClassCastExceptionfrom inside the codec on publish, a value of the wrong class inFlow<T>on subscribe. - codecForContentType(java.lang.String) - function in eu.vstoyanov.natsy.codec.CodecRegistry
- Get codec by content type header
- CodecRegistry - class in eu.vstoyanov.natsy.codec
- Registry for message codecs used for serialization/deserializationSupports pluggable serialization strategies and automatic content-type negotiation
- CodecRegistry.Builder - class in eu.vstoyanov.natsy.codec.CodecRegistry
- Builder for CodecRegistry
- CodecRegistryKt - class in eu.vstoyanov.natsy.codec
- codecs(kotlin.jvm.functions.Function1) - function in eu.vstoyanov.natsy.KlientConfigBuilder
- Configure codecs for serialization/deserialization
- configureJson(kotlin.jvm.functions.Function1) - function in eu.vstoyanov.natsy.codec.CodecRegistry.Builder
- Adjust the Json instance that backs every JSON codecThe block starts from the registry's defaults (lenient, unknown keys ignored, defaults not encoded) and changes only what it names:
A codec captures the configuration when it is registered, so this has to come first.codecs { configureJson { explicitNulls = false } registerJson(OrderEvent::class, OrderEvent.serializer()) } - consumer(java.lang.String,java.lang.String,kotlin.jvm.functions.Function1) - function in eu.vstoyanov.natsy.jetstream.JetStreamContext
- Create or update a JetStream consumerIf the consumer doesn't exist, a new one is created from the configuration block.
- consumer(java.lang.String,kotlin.jvm.functions.Function1) - function in eu.vstoyanov.natsy.jetstream.StreamContext
- Create or update a consumer on this streamIf the consumer doesn't exist, a new one is created from the configuration block.
- ConsumerConfig - class in eu.vstoyanov.natsy.jetstream
- DSL for configuring JetStream consumersExample usage:
val consumerCtx = js.consumer("MY_STREAM", "MY_CONSUMER") { durable = "MY_CONSUMER" deliverPolicy = DeliverPolicy.ALL ackPolicy = AckPolicy.EXPLICIT ackWait = 30.seconds maxDeliver = 5 filterSubject = "orders.>" } - ConsumerConfigBuilder - class in eu.vstoyanov.natsy.jetstream
- Builder for JetStream consumer configuration
- ConsumerContext - class in eu.vstoyanov.natsy.jetstream
- Context for JetStream consumer operationsProvides access to consumer management and monitoring including:
Consumer information and updates
Pause/resume operations
Monitoring metrics
val consumerCtx = js.consumer("MY_STREAM", "MY_CONSUMER") { durable = "MY_CONSUMER" ackPolicy = AckPolicy.EXPLICIT maxDeliver = 5 } // Update the consumer consumerCtx.update { maxDeliver = 10 } // Pause the consumer until it is explicitly resumed consumerCtx.pause() // ...or until a deadline, after which the server resumes it automatically consumerCtx.pause(30.minutes) // Everything worth monitoring, in one round trip val stats = consumerCtx.stats() println("${stats.ackPending} unacknowledged, ${stats.pending} still to come") - consumers() - function in eu.vstoyanov.natsy.jetstream.StreamContext
- List all consumers on this streamA failure reaches the collector rather than completing the flow: an empty result means the stream has no consumers, and nothing else.
- ConsumerStats - class in eu.vstoyanov.natsy.jetstream.model
- A snapshot of everything worth monitoring about a consumer, from one server round trip.
- create(kotlin.jvm.functions.Function1) - function in eu.vstoyanov.natsy.NatsKlient.Companion
- Creates a new NatsKlient instance with DSL configuration
- create(java.lang.String,T) - function in eu.vstoyanov.natsy.jetstream.KeyValueStore
- Create a new key only if it does not already exist