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

    Type Alias JetStreamPublishOptions

    Options for messages published to JetStream

    type JetStreamPublishOptions = {
        cancelSchedule?: ScheduleCancellation;
        expect: Partial<StreamExpectations>;
        headers: MsgHdrs;
        msgID: string;
        retries?: number;
        schedule?: ScheduleOptions;
        timeout: number;
        ttl?: string;
    }
    Index

    Properties

    cancelSchedule?: ScheduleCancellation

    Atomically cancels a schedule as part of this publish. The published message lands on its normal subject; the named schedule is removed server-side in the same operation.

    The publish subject MUST NOT equal ScheduleCancellation.scheduleSubject (the server would purge the cancellation message itself).

    Combine with StreamExpectations.lastSubjectSequence + StreamExpectations.lastSubjectSequenceSubject to make the cancel conditional on the schedule still existing at a given sequence.

    Requires server v2.14.0+.

    expect: Partial<StreamExpectations>

    Set of constraints that when specified are verified by the server. If the constraint(s) doesn't match, the server will reject the message. These settings allow you to implement deduplication and consistency strategies.

    headers: MsgHdrs

    Headers associated with the message. You can create an instance of MsgHdrs with the headers() function.

    msgID: string

    A string identifier used to detect duplicate published messages. If the msgID is reused within the stream's duplicate_window, the message will be rejected by the stream, and the PubAck will mark it as a duplicate.

    retries?: number

    Continue to attempt to publish if the publish fails due to a no responders error. Default is 1.

    schedule?: ScheduleOptions

    Specifies the schedule for the message.

    timeout: number

    The number of milliseconds to wait for the PubAck

    ttl?: string

    Sets PubHeaders.MessageTTL this only applies to streams that enable StreamConfig.allow_msg_ttl. The format of this value is "1s" or "1h", etc, or a plain number interpreted as the number of seconds.