Skip to content

How can I create a durable consumer? #234

Closed Answered by mtmk
robertmircea asked this question in Q&A
Discussion options

You must be logged in to vote

I think you might be hitting a bug. When you turn on logging do you see warnings of 409 Exceeded MaxRequestBatch?

Consume batch size is 1000 by default. Assuming your options.BatchSize is less, can you try this see if it helps:

var opts = new NatsJSConsumeOpts { MaxMsgs = options.BatchSize };
await foreach (var msg in consumer.ConsumeAsync(opts: opts, serializer: msgSerializer).WithCancellation(cancellationToken))
{
    // ...
}

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@mtmk
Comment options

mtmk Nov 25, 2023
Maintainer

@robertmircea
Comment options

@mtmk
Comment options

mtmk Nov 25, 2023
Maintainer

Answer selected by robertmircea
@robertmircea
Comment options

@robertmircea
Comment options

@robertmircea
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@mtmk
Comment options

mtmk Nov 25, 2023
Maintainer

@robertmircea
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants