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

Function WithMsgID

jetstream/jetstream_options.go:603–608  ·  view source on GitHub ↗

WithMsgID sets the message ID used for deduplication.

(id string)

Source from the content-addressed store, hash-verified

601
602// WithMsgID sets the message ID used for deduplication.
603func WithMsgID(id string) PublishOpt {
604 return func(opts *pubOpts) error {
605 opts.id = id
606 return nil
607 }
608}
609
610// WithMsgTTL sets per msg TTL.
611// Requires [StreamConfig.AllowMsgTTL] to be enabled.

Callers 4

TestMessageDetailsFunction · 0.92
TestPublishMsgFunction · 0.92
TestPublishFunction · 0.92
TestPublishMsgAsyncFunction · 0.92

Calls

no outgoing calls

Tested by 4

TestMessageDetailsFunction · 0.74
TestPublishMsgFunction · 0.74
TestPublishFunction · 0.74
TestPublishMsgAsyncFunction · 0.74