NATS Jetstream: Freeze consumer #1860
Unanswered
truongnhatanh7
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Update, use the demo nats server to test and the issue still persists -> The problem maybe originated from client side |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hello @truongnhatanh7. So when it freezes, you don't see any errors being reported in And second question, are you sure there is no error when running consumeCtx, err := consumer.Consume(func(msg jetstream.Msg) {
// handler
}, jetstream.ConsumeErrHandler(func(consumeCtx jetstream.ConsumeContext, err error) {
logger.Logger.Errorf("failed to consume msg: %v", err)
}))
if err != nil {
// log error here
return
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context: I got a running http server. Before the http server is ran, I run
RegisterListeneron main goroutine to register the listener.Next: I deployed nats via helm chart on a VPS on K8S (https://nats-io.github.io/k8s/helm/charts/), I could use the CLI from local to list all streams in the remote NATS.
My problem: Using nats docker image on local, my code could dispatch and consume event normally (default setting + jetstream), but when using NATS on k8s, it hangs indefinitely.
This is my custom config:
The rest is default.
I've tried serveral consume pattern with the local nats docker and it works fine so I don't think the problem is coming from the consume logic. The problem only occurs when I use local + nats on k8s (vps), or when I deploy my code to ECS + nats on k8s (vps). I did check all the subject name + network ping + ..., it all works fine.
Beta Was this translation helpful? Give feedback.
All reactions