Question about nats pub/sub #945
Replies: 4 comments
-
When you subscribe you queue up the interest to the system, but you do that after you send []byte("1"), so when the system processes that message there is no interest in "topic". |
Beta Was this translation helpful? Give feedback.
-
Thanks @derekcollison , makes perfect sense. I think Basic Usage in readme might need to be updated as I was running the example from there and couldn't figure out what was I doing wrong. Then I ran the basic usage from nats.js in node and it worked as subscribe came before publish (if this is as expected then feel free to close this issue). Also, I just migrate from Kafka to Nats for one of my projects, It's pretty cool. Thanks! |
Beta Was this translation helpful? Give feedback.
-
What about 'limitedPolicy' and 'WorkQueuePolicy' if The Retention in Jetstream is not InterestPolicy? |
Beta Was this translation helpful? Give feedback.
-
These are separate issues in my opinion. JetStream allows you to persist messages, so the "interest" is JetStream itself, so users can come along at a later date and consume a message. JetStream can also be used to do global flow control, and if you need a globally ordered set of messages. |
Beta Was this translation helpful? Give feedback.
-
Hey, I had a question, why don’t I see
Received: 1
as output?Output:
Beta Was this translation helpful? Give feedback.
All reactions