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)
| 641 | // subject has a different sequence number server will reject the message and |
| 642 | // publish will fail. |
| 643 | func 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 |
no outgoing calls