Type Alias JetStreamClient

JetStreamClient: {
    apiPrefix: string;
    consumers: Consumers;
    streams: Streams;
    getOptions(): JetStreamOptions;
    jetstreamManager(checkAPI?: boolean): Promise<JetStreamManager>;
    publish(
        subj: string,
        payload?: Payload,
        options?: Partial<JetStreamPublishOptions>,
    ): Promise<PubAck>;
}

A type for interacting data stored in JetStream

Type declaration

  • apiPrefix: string

    Returns the JS API prefix as processed from the JetStream Options

  • consumers: Consumers

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

  • streams: Streams

    Returns an object for accessing Streams.

  • getOptions:function
  • jetstreamManager:function
    • Returns a JetStreamManager that uses the same JetStreamOptions as the current JetStream context

      Parameters

      • OptionalcheckAPI: boolean

      Returns Promise<JetStreamManager>

  • publish:function
    • Publishes a message to a stream. If not stream is configured to store the message, the request will fail with RequestError error with a nested NoRespondersError.

      Parameters

      • subj: string

        the subject for the message

      • Optionalpayload: Payload

        the message's data

      • Optionaloptions: Partial<JetStreamPublishOptions>

        the optional message

      Returns Promise<PubAck>