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

Function WithExpectLastSequencePerSubject

jetstream/jetstream_options.go:643–648  ·  view source on GitHub ↗

WithExpectLastSequencePerSubject sets the expected sequence number the last message on a subject the message is published to. If the last message on a subject has a different sequence number server will reject the message and publish will fail.

(seq uint64)

Source from the content-addressed store, hash-verified

641// subject has a different sequence number server will reject the message and
642// publish will fail.
643func WithExpectLastSequencePerSubject(seq uint64) PublishOpt {
644 return func(opts *pubOpts) error {
645 opts.lastSubjectSeq = &seq
646 return nil
647 }
648}
649
650// WithExpectLastSequenceForSubject sets the sequence and subject for which the
651// last sequence number should be checked. If the last message on a subject

Callers 3

TestPublishMsgFunction · 0.92
TestPublishMsgAsyncFunction · 0.92
updateRevisionMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestPublishMsgFunction · 0.74
TestPublishMsgAsyncFunction · 0.74