import { type ConsumerOptsBuilder } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";
A builder API that creates a ConsumerOpt
Methods
consumer will start with messages received on the specified time/date
Messages delivered to the consumer will not have a payload. Instead,
they will have the header Nats-Msg-Size
indicating the number of bytes
in the message as stored by JetStream.
Consumer will ack all messages - not that unless manualAck is set the client will auto ack messages after processing via its callback or when the iterator continues processing.
Sets the time a delivered message might remain unacknowledged before a redelivery is attempted
Consumer should filter the messages to those that match the specified filter. This api can be called multiple times.
Pull subscriber option only. Limits the maximum outstanding messages scheduled via batch pulls as pulls are additive.
Max number of outstanding acks before the server stops sending new messages
Push consumer only option - Enables idle heartbeats from the server. If the number of specified millis is reached and no messages are available on the server, the server will send a heartbeat (status code 100 message) indicating that the JetStream consumer is alive.
Push consumer flow control - the server sends a status code 100 and uses the delay on the response to throttle inbound messages for a client and prevent slow consumer.
Push consumer only option - Sets the name of the queue group - same as queue
Prevents the consumer implementation from auto-acking messages. Message callbacks and iterators must explicitly ack messages.
Standard NATS subscription option which automatically closes the subscription after the specified number of messages (actual stream or flow control) are seen by the client.
Push consumer only option - Standard NATS queue group option, same as deliverGroup
Use a callback to process messages. If not specified, you process messages by iterating on the returned subscription object.
Push consumer only - creates an ordered consumer - ordered consumers cannot be a pull consumer nor specify durable, deliverTo, specify an ack policy, maxDeliver, or flow control.
Bind to the specified durable (or consumer name if ephemeral) on the specified stream. If the consumer doesn't exist, the subscribe will fail. Bind the recommended way of subscribing to a stream, as it requires the consumer to exist already.
Specify the name of the stream, avoiding a lookup where the stream is located by searching for a subject.
Pull consumer only - Sets the max number of messages that can be pulled in a batch that can be requested by a client during a pull.
Pull consumer only - Sets the max amount of time before a pull request expires that may be requested by a client during a pull.
Pull consumer only - Sets the max amount of time that an ephemeral consumer will be allowed to live on the server. If the client doesn't perform any requests during the specified interval the server will discard the consumer.
Force the consumer state to be kept in memory rather than inherit the setting from the Stream
When set do not inherit the replica count from the stream but specifically set it to this amount