@nats-io/jetstream
    Preparing search index...

    Type Alias ConsumerAPI

    type ConsumerAPI = {
        add(
            stream: string,
            cfg: Partial<ConsumerConfig>,
            opts?: ConsumerCreateOptions,
        ): Promise<ConsumerInfo>;
        addOrUpdate(
            stream: string,
            cfg: Partial<ConsumerConfig>,
            opts?: ConsumerCreateOptions,
        ): Promise<ConsumerInfo>;
        delete(stream: string, consumer: string): Promise<boolean>;
        info(stream: string, consumer: string): Promise<ConsumerInfo>;
        list(stream: string): Lister<ConsumerInfo>;
        pause(
            stream: string,
            name: string,
            until?: Date,
        ): Promise<{ pause_until?: string; paused: boolean }>;
        reset(
            stream: string,
            name: string,
            seq?: number,
        ): Promise<ConsumerResetResponse>;
        resume(
            stream: string,
            name: string,
        ): Promise<{ pause_until?: string; paused: boolean }>;
        unpin(stream: string, name: string, group: string): Promise<void>;
        update(
            stream: string,
            durable: string,
            cfg: Partial<ConsumerUpdateConfig>,
        ): Promise<ConsumerInfo>;
    }
    Index
    • Deletes the specified consumer name/durable from the specified stream.

      Parameters

      • stream: string
      • consumer: string

      Returns Promise<boolean>

    • Returns the ConsumerInfo for the specified consumer in the specified stream.

      Parameters

      • stream: string
      • consumer: string

      Returns Promise<ConsumerInfo>

    • Lists all the consumers on the specified streams

      Parameters

      • stream: string

      Returns Lister<ConsumerInfo>

    • Pauses the consumer until the specified Date

      Parameters

      • stream: string
      • name: string
      • Optionaluntil: Date

      Returns Promise<{ pause_until?: string; paused: boolean }>

    • Resets the consumer's delivery state without deleting and recreating it. If seq is provided, the next message delivered will have a stream sequence >= seq. If omitted, state is reset but the ack floor stream sequence is preserved.

      Requires server v2.14.0+. Only allowed on consumers configured with DeliverPolicy=all, by_start_sequence, or by_start_time. See ADR-60.

      Parameters

      • stream: string
      • name: string
      • Optionalseq: number

        optional stream sequence to reset to

      Returns Promise<ConsumerResetResponse>

    • Resumes a paused Consumer, returning whether it is paused and when it will resume.

      Parameters

      • stream: string
      • name: string

      Returns Promise<{ pause_until?: string; paused: boolean }>

    • Unpins the currently pinned consumer.

      Parameters

      • stream: string
      • name: string
      • group: string

      Returns Promise<void>

    • Updates the consumer configuration for the specified consumer on the specified stream that has the specified durable name. The update is applied to the consumer's current configuration, so fields that are not set keep their values. Setting either filter_subject or filter_subjects replaces the consumer's filter, whichever of the two it had.

      Parameters

      Returns Promise<ConsumerInfo>