NATS Work Queue handles messages synchronous #1307
Replies: 1 comment 4 replies
-
Okay I read the docs better (https://faststream.airt.ai/latest/nats/examples/direct/?h=scaling). Indeed by setting |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to setup multiple tasks handlers with NATS which will hook into messages like
user.signup
,user.signin
,user.payment
etc. So I created a test.In this task
user.signup
I will do normal work etc. This task should be executed exactly once, therefor theRetentionPolicy.WORK_QUEUE
policy. This works all fine as expected. Tasks are handled once a worker is connected.But these messages are handled synchronously... I expected the
handler
function to be called multiple times without waiting for earlier tasks to finish. In the output you can see that the handler waits for each task to be finished before handling new tasks.Here is my code, I probably misconfigured something I guess. Help really appreciated. I am currently learning NATS :)
And the output:
Beta Was this translation helpful? Give feedback.
All reactions