Interface ConsumerOptsBuilder

A builder API that creates a ConsumerOpt

Hierarchy

  • ConsumerOptsBuilder

Methods

  • 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.

    Returns ConsumerOptsBuilder

  • Sets the time a delivered message might remain unacknowledged before a redelivery is attempted

    Parameters

    • millis: number

    Returns ConsumerOptsBuilder

  • 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.

    Parameters

    • stream: string
    • durable: string

    Returns ConsumerOptsBuilder

  • Specify the name of the stream, avoiding a lookup where the stream is located by searching for a subject.

    Parameters

    • stream: string

    Returns ConsumerOptsBuilder

  • Push consumer only option - Sets the name of the queue group - same as queue

    Parameters

    • name: string

    Returns ConsumerOptsBuilder

  • DeliverTo sets the subject where a push consumer receives messages

    Parameters

    • subject: string

    Returns ConsumerOptsBuilder

  • Sets the durable name, when not set an ephemeral consumer is created

    Parameters

    • name: string

    Returns ConsumerOptsBuilder

  • Consumer should filter the messages to those that match the specified filter. This api can be called multiple times.

    Parameters

    • s: string

    Returns ConsumerOptsBuilder

  • 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.

    Returns ConsumerOptsBuilder

  • 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.

    Returns ConsumerOptsBuilder

  • 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.

    Parameters

    • millis: number

    Returns ConsumerOptsBuilder

  • 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.

    Parameters

    • millis: number

    Returns ConsumerOptsBuilder

  • Limit message delivery to the specified rate in bits per second.

    Parameters

    • bps: number

    Returns ConsumerOptsBuilder

  • Prevents the consumer implementation from auto-acking messages. Message callbacks and iterators must explicitly ack messages.

    Returns ConsumerOptsBuilder

  • Max number of outstanding acks before the server stops sending new messages

    Parameters

    • max: number

    Returns ConsumerOptsBuilder

  • Max number of re-delivery attempts for a particular message

    Parameters

    • max: number

    Returns ConsumerOptsBuilder

  • 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.

    Parameters

    • max: number

    Returns ConsumerOptsBuilder

  • 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.

    Parameters

    • n: number

    Returns ConsumerOptsBuilder

  • Pull consumer only - Sets the max amount of time before a pull request expires that may be requested by a client during a pull.

    Parameters

    • millis: number

    Returns ConsumerOptsBuilder

  • Pull subscriber option only. Limits the maximum outstanding messages scheduled via batch pulls as pulls are additive.

    Parameters

    • max: number

    Returns ConsumerOptsBuilder

  • Force the consumer state to be kept in memory rather than inherit the setting from the Stream

    Returns ConsumerOptsBuilder

  • When set do not inherit the replica count from the stream but specifically set it to this amount

    Parameters

    • n: number

    Returns ConsumerOptsBuilder

  • 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.

    Returns ConsumerOptsBuilder

  • Start delivering at the at a past point in time

    Parameters

    • millis: number

    Returns ConsumerOptsBuilder

  • The consumer will start at the message with the specified sequence

    Parameters

    • seq: number

    Returns ConsumerOptsBuilder

  • consumer will start with messages received on the specified time/date

    Parameters

    • time: Date

    Returns ConsumerOptsBuilder

Generated using TypeDoc