MCPcopy
hub / github.com/nats-io/nats.go / WithExpectLastMsgID

Function WithExpectLastMsgID

jetstream/jetstream_options.go:668–673  ·  view source on GitHub ↗

WithExpectLastMsgID sets the expected message ID the last message on a stream should have. If the last message has a different message ID server will reject the message and publish will fail.

(id string)

Source from the content-addressed store, hash-verified

666// should have. If the last message has a different message ID server will
667// reject the message and publish will fail.
668func WithExpectLastMsgID(id string) PublishOpt {
669 return func(opts *pubOpts) error {
670 opts.lastMsgID = id
671 return nil
672 }
673}
674
675// WithRetryWait sets the retry wait time when ErrNoResponders is encountered.
676// Defaults to 250ms.

Callers 2

TestPublishMsgFunction · 0.92
TestPublishMsgAsyncFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestPublishMsgFunction · 0.74
TestPublishMsgAsyncFunction · 0.74