Interface Consumers

interface Consumers {
    get(stream, name?): Promise<Consumer>;
    getPullConsumerFor(info): Consumer;
}

Methods

  • Returns the Consumer configured for the specified stream having the specified name. Consumers are typically created with JetStreamManager. If no name is specified, the Consumers API will return an ordered consumer.

    An ordered consumer expects messages to be delivered in order. If there's any inconsistency, the ordered consumer will recreate the underlying consumer at the correct sequence. Note that ordered consumers don't yield messages that can be acked because the client can simply recreate the consumer.

    Consumer.

    Parameters

    • stream: string
    • Optional name: string | Partial<OrderedConsumerOptions>

      or OrderedConsumerOptions - if not specified an ordered consumer is created with the specified options.

    Returns Promise<Consumer>

  • Returns a Consumer based on the ConsumerInfo specified. Note this method can throw, and it doesn't validate that the underlying consumer exists. When using a consumer obtained by this method it is important to check for ConsumerEvents#HeartbeatsMissed

    Parameters

    Returns Consumer