Open abh opened 2 years ago
Nats sink still beta and without Jetstream support. Any plans to support Jetstream ?
Hey @sghazaryan ! This isn't on our near term roadmap, but we are happy to help support a contribution here for anyone so motivated.
Hey @jszwedko ! Thank you for answer. Hope after async_nats update jetstream suppot will be implemented.
I can work on this somewhere in Q4. Happy to be asigned to it.
I can work on this somewhere in Q4. Happy to be asigned to it.
That'd be great!
We realized that the current sink can also flood the JetStream as it sends all messages as Core NATS publisher.
Changing to JetStream publish would not only allow actual acks to be available, but also introduce new sets of possible errors (non existing streams for published subjects etc).
How would you like that to be handled:
- a option to use either JetStream or Core NATS? (Core NATS sink can make sense too)?
I think this would make sense. If it diverges enough we may want a separate sink, but if it is only minor modifications to the implementation and user-configuration structures then just updating the nats
sink seems sensible.
- is it ok to introduce new errors to the sink?
Yes, I think this would be ok. Again it really depends on how much the Jetstream sink behavior diverges from the existing NATS sink.
It diverges quite a bit in one sense @jszwedko :
Current sink can publish into Core NATS subjects, meaning very performant at-most-once
without persistence (and NATS does not have the concept of creating subjects, its all based on interest graph).
With JetStream, there is at-least-once
, and a persistence layer.
JetStream publish
will fail if stream for given subject does not exist, which would be a breaking change.
If there are use cases in Vector for non-persistent sink, then it would break those.
If Vector should always be used with JetStream - then it's fine, though I suppose it's the former.
Then, a separate sink sounds more sensible?
Thanks for the additional detail @abh . JetStream still relies on the NATS protocol, though, right? Even though the messages are handled differently.
Yes. JetStream is built on top of Core NATS.
👍 in that case what exactly is missing from the existing nats
sink to be able to publish to JetStream?
@jszwedko It is able to publish to JetStream, but:
publish
, instead of requet
, or rather - jetstram.Publish
, that allows it receive ackjetstream.Publish
, it is publishing without any throughput control, flooding JetStream with messages.
As mentioned in #8112 the nats sink was merged without jetstream support. At least for my use case, jetstream is an essential feature for the log pipeline.
(see also #10533 for authentication and TLS)