Replies: 4 comments
-
I'm not affiliated with NATS at all, just a user, but you'd probably get more timely advice over in the NATS Slack account (I'm not sure that a GitHub issue in the Kubernetes section of the NATS Org is the place for a non-code related query, but could be wrong :-) ) I imagine that given streaming systems are supposed to allow for reduced coupling between publishers and subscribers, it doesn't make much sense to centralise the stream config. Though the NATS Operator chart does allow custom CRD's to manage streams if you wanted that. If you're on K8s, you could also consider a sidecar or init container placed somewhere in order to create the stream outside of the application scope. The world is your oyster, but I'd definitely look to Slack for faster more experienced recommendations |
Beta Was this translation helpful? Give feedback.
-
Yeah, I thought of init container but I was just wondering how other people do this. I will probably try the operator, thank you @TheQueenIsDead. At the moment I do this from app (Go), but I don't like that solution. |
Beta Was this translation helpful? Give feedback.
-
We personally have apps that startup and are allowed to create the stream they will publish to, or update it if it exists. Double check in Slack, will definitely get you a wider range of opinions 👍 |
Beta Was this translation helpful? Give feedback.
-
@acim the most simple way would be to just let the applications create the streams as required, you could also try to use the CRDs from this repo and create them via YAML: https://github.com/nats-io/nack |
Beta Was this translation helpful? Give feedback.
-
I started experimenting with JetStream and as far I could figure out, it is necessary to create streams before using them. I found out Go example how to do that and it works, but if I use Go to create streams this means that my applications that use NATS JetStream have to do that. Is that the recommended way?
I think it would be more practical to be able to create streams on server start, for example by having configuration (a list or list of objects) here where we could put all streams that should be created if not existing already.
Maybe I am missing something, so please advise how to do this properly.
Beta Was this translation helpful? Give feedback.
All reactions