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

Function PullMaxMessagesWithBytesLimit

jetstream/jetstream_options.go:172–174  ·  view source on GitHub ↗

PullMaxMessagesWithBytesLimit limits the number of messages to be buffered in the client. Additionally, it sets the maximum size a single fetch request can have. Note that this will not limit the total size of messages buffered in the client, but rather can serve as a way to limit what nats server w

(maxMessages, byteLimit int)

Source from the content-addressed store, hash-verified

170// PullMaxMessagesWithBytesLimit implements both PullConsumeOpt and
171// PullMessagesOpt, allowing it to configure Consumer.Consume and Consumer.Messages.
172func PullMaxMessagesWithBytesLimit(maxMessages, byteLimit int) pullMaxMessagesWithBytesLimit {
173 return pullMaxMessagesWithBytesLimit{maxMessages, byteLimit}
174}
175
176func (m pullMaxMessagesWithBytesLimit) configureConsume(opts *consumeOpts) error {
177 if m.maxMessages <= 0 {

Callers 2

TestPullConsumerMessagesFunction · 0.92
TestPullConsumerConsumeFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestPullConsumerMessagesFunction · 0.74
TestPullConsumerConsumeFunction · 0.74