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

Function WithExpectLastSequence

jetstream/jetstream_options.go:632–637  ·  view source on GitHub ↗

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

(seq uint64)

Source from the content-addressed store, hash-verified

630// on a stream should have. If the last message has a different sequence number
631// server will reject the message and publish will fail.
632func WithExpectLastSequence(seq uint64) PublishOpt {
633 return func(opts *pubOpts) error {
634 opts.lastSeq = &seq
635 return nil
636 }
637}
638
639// WithExpectLastSequencePerSubject sets the expected sequence number the last
640// message on a subject the message is published to. If the last message on a

Callers 2

TestPublishMsgFunction · 0.92
TestPublishMsgAsyncFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestPublishMsgFunction · 0.74
TestPublishMsgAsyncFunction · 0.74