import { type JsMsg } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";
Represents a message stored in JetStream
Properties
The delivery info for the message
Any headers associated with the message
Methods
Indicate to the JetStream server that processing of the message failed, and that it should be resent after the spefied number of milliseconds.
Indicate to the JetStream server that processing of the message is on going, and that the ack wait timer for the message should be reset preventing a redelivery.
!! this is an experimental feature - and could be removed
next() combines ack() and pull(), requires the subject for a subscription processing to process a message is provided (can be the same) however, because the ability to specify how long to keep the request open can be specified, this functionality doesn't work well with iterators, as an error (408s) are expected and needed to re-trigger a pull in case there was a timeout. In an iterator, the error will close the iterator, requiring a subscription to be reset.
Indicate to the JetStream server that processing of the message failed and that the message should not be sent to the consumer again.
Indicate to the JetStream server that the message was processed successfully and that the JetStream server should acknowledge back that the acknowledgement was received.
Convenience method to parse the message payload as JSON. This method will throw an exception if there's a parsing error;