Type Alias Consumers

Consumers: {
    get(
        stream: string,
        name?: string | Partial<OrderedConsumerOptions>,
    ): Promise<Consumer>;
    getBoundPushConsumer(opts: BoundPushConsumerOptions): Promise<PushConsumer>;
    getConsumerFromInfo(ci: ConsumerInfo): Consumer;
    getPushConsumer(
        stream: string,
        name?: string | Partial<OrderedPushConsumerOptions>,
    ): Promise<PushConsumer>;
}

Type declaration

  • get:function
    • 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
      • Optionalname: string | Partial<OrderedConsumerOptions>

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

      Returns Promise<Consumer>

  • getBoundPushConsumer:function
  • getConsumerFromInfo:function
    • Returns a PullConsumer configured for the specified ConsumerInfo. Note this API doesn't create or check that the consumer exists. It simply returns a Consumer that you can use to process messages. This method should only be used when avoiding extra ConsumerInfo. If the underlying consumer doesn't exist, the consumer will raise heartbeat_missed notifications.

      Parameters

      Returns Consumer

  • getPushConsumer:function