Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Redis] [NATS Jetstream] msg.Ack not working, am I missing something? #531

Open
yohanleb opened this issue Jan 5, 2025 · 1 comment
Open

Comments

@yohanleb
Copy link

yohanleb commented Jan 5, 2025

Hello,

I tried to set up watermill with Redis and Nats Jetstream and the messages I was sending kept going back on my server restart even tho I was doing msg.Ack on every message after logging them:

func handleEvents(messages <-chan *message.Message) {
	for msg := range messages {
		zap.L().Info("message received", zap.Any("msg", msg))
		msg.Ack()
	}
}

I saw an option WorkQueuePolicy that might not be set by default on Nats Jetstream but not sure what's happening for Redis?

image

Also, I had no issues with RabbitMQ, messages are not coming back after being acknowledged. I'm new to event handling so a bit of help would be appreciated!

Thanks

@yohanleb
Copy link
Author

yohanleb commented Jan 5, 2025

Update, this seems to work for NATS Jetstream:

var subscribeOptions = []nc.SubOpt{
    nc.DeliverNew(),
    nc.AckExplicit(),
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant