Interface JetStreamClient

Interface for interacting with JetStream data

Hierarchy

  • JetStreamClient

Properties

apiPrefix: string

Returns the JS API prefix as processed from the JetStream Options

consumers: Consumers

Returns the interface for accessing Consumers. Consumers allow you to process messages stored in a stream. To create a consumer use JetStreamManager.

streams: Streams

Returns the interface for accessing Streams.

views: Views

Accessor for the JetStream materialized views API

Methods

  • Similar to pull, but able to configure the number of messages, etc. via PullOptions.

    Deprecated

    Parameters

    • stream: string

      the name of the stream

    • durable: string

      the consumer's durable name (if durable) or name if ephemeral

    • Optional opts: Partial<PullOptions>

    Returns QueuedIterator<JsMsg>

  • Returns a JetStreamManager that uses the same JetStreamOptions as the current JetStream context

    Parameters

    • Optional checkAPI: boolean

    Returns Promise<JetStreamManager>

  • Publishes a message to a stream. If not stream is configured to store the message, the request will fail with NoResponders error.

    Parameters

    • subj: string

      the subject for the message

    • Optional payload: Payload

      the message's data

    • Optional options: Partial<JetStreamPublishOptions>

      the optional message

    Returns Promise<PubAck>

  • Retrieves a single message from JetStream

    Deprecated

    Parameters

    • stream: string

      the name of the stream

    • consumer: string

      the consumer's durable name (if durable) or name if ephemeral

    • Optional expires: number

      the number of milliseconds to wait for a message

    Returns Promise<JsMsg>

  • Creates a pull subscription. A pull subscription relies on the client to request more messages from the server. If the consumer doesn't exist, it will be created matching the consumer options provided.

    It is recommended that a consumer be created first using JetStreamManager APIs and then use the bind option to simply attach to the created consumer.

    If the filter subject is not specified in the options, the filter will be set to match the specified subject.

    It is more efficient than fetch or pull because a single subscription is used between invocations.

    Deprecated

    Parameters

    Returns Promise<JetStreamPullSubscription>

  • Creates a push subscription. The JetStream server feeds messages to this subscription without the client having to request them. The rate at which messages are provided can be tuned by the consumer by specifying ConsumerConfig.rate_limit_bps and/or maxAckPending.

    It is recommended that a consumer be created first using JetStreamManager APIs and then use the bind option to simply attach to the created consumer.

    If the filter subject is not specified in the options, the filter will be set to match the specified subject.

    Deprecated

    Parameters

    Returns Promise<JetStreamSubscription>

Generated using TypeDoc