Relative Content

Tag Archive for c#.netnats.ionats-jetstream

NATS JetStream messages being processed multiple times by my consumer even when messages are acknowledged

I’m using NATS JetStream to publish and consume messages in a .NET 8 application using NATS.Net. While publishing 10 messages, my consumer processes each message twice, despite calling msg.AckAsync().Interestingly, changing the MaxDeliver setting results in messages being processed more times accordingly. If I don’t set MaxDeliver then message get processed only once. Below is my code for both publishing and consuming messages: