-
Notifications
You must be signed in to change notification settings - Fork 28
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
[question] Unnamed stream workaround #23
Comments
Hello! Can you find an example of getting stream name by subject in javascript? |
idea is "configure broker to automatically resolve stream name by subject" thats why its "jetstream" not just "stream" it should allow to configure streams/consumers/filters/modes OUTSIDE application code (in difference with redis where you MUST define the key to save like BUCKET in nats does). There is normal pub/sub behavior to use with known stream/queue names, jet-stream should automate the process. as you see in GoLang code - there is possibility to create "unnamed stream" and still push to that stream, you dont need to create stream directly in application. actually unnamed stream is not a "stream", its just an engine that allows publishing messaging. GoLang code in that library is not enough clean to understand, PHP is more "clean" language for that stuff, but if we explore Nats Docs we see that stream in most cases could be configured even at "account" level - and dot separators does half of the job in that. This case of composer am not sure nats returns errcode 1 if stream not exists... For now, i could not fully understand the flow, but if we see some videos on youtube about nats - the concept is "SUBJECT", not "STREAM". And even then we dont need to cut any string in application, nats have to understand by part of subject what streams have to copy incoming message to their consumers. You send "commands.booking.doSome.123" and nats could by some way undestrand that this message should be delivered to certain stream, and then consumers using The reason i've just made this issue - my teamlead correct me that "it is not the redis".
In that case "Stream" object is not a concrete stream but "JetStreamEngine" allows to publish any subject to nats. And the application will not hardcode allowed stream and subject names anywhere. You just call something like:
Personally for me its little bit unexpectable behavior, but it does. |
I had just done it unexpectedly easely:
|
Am trying to do same thing in PHP. PHP api allows ->getStream() by its name, my lead sad that nats can automatically resolve stream name by subject. Could you please provide me with some solution in PHP?
Guess, in defaultURL could be stream name and lead guy just dont mention that?
The text was updated successfully, but these errors were encountered: