nats-io / stan.go

NATS Streaming System
https://nats.io
Apache License 2.0
706 stars 117 forks source link

Is there a c/c++ client for nats-streaming? #102

Closed nellson closed 6 years ago

aricart commented 8 years ago

Not yet!

kozlovic commented 8 years ago

@nellson Thank you for your interest. Unfortunately, there is no C/C++ client for NATS Streaming at this time, as we have other priorities. Is this something that you would need in the short term, or just curious about it?

nellson commented 8 years ago

@kozlovic Thank you for your reply. I am a senior engineer in Tencent, and looking for a message queue for Tecent Game. I have tested Kafka\RabbitMQ\Nats and Nats Streaming, and really impressed by the Nats's performance. And Nats is really easy to use and deploy.

However we need a message queue with persistence, so I choose Nats Streaming, but we mainly develop use c/c++. So I have to only two choice: 1. Fork NATS and add persistence. 2 Wait for Nats Streaming C Client, but the question is when there will be? Could you give me more information?

kozlovic commented 8 years ago

@nellson Our community manager Brian Flannery will jump in to discuss your requirements in more details. Thanks.

bjflanne commented 8 years ago

@nellson -- can you drop me a message at brian@nats.io to set up a time to discuss further? Look forward to it!

nellson commented 8 years ago

@bjflanne @kozlovic Thanks a lot! I will send a email to bjflanne to set up a time.

Jamby93 commented 7 years ago

Got the same question, I'm about in the same situation of @nellson. Would you mind share the private discussion's result in order to help who find this thread searching on google? Thanks

arifsetiawan commented 6 years ago

We also interested on this. Is there any news you guys can share?

ColinSullivan1 commented 6 years ago

Reopening this issue; this is gaining momentum.

One option we'd like to explore is using the -buildmode flag. This may be best as wrapper functions in a new package over go-nats-streaming so the exports are C-friendly and to work around the main package requirement, but experimentation is needed.

-buildmode=c-shared
    Build the listed main package, plus all packages it imports,
    into a C shared library. The only callable symbols will
    be those functions exported using a cgo //export comment.
    Requires exactly one main package to be listed.

A great writeup of how this works can be found here, with a corresponding repository.

There are still a multitude of unanswered questions here (e.g. what about handling structures?), but I'd like to open this up to the community for comments or offers to contribute.

fro0m commented 6 years ago

there is a great need in cxx realization

santiGoncalves commented 6 years ago

will there be any cnats streaming? we are at the moment to choose between rabbitmq kafka and nats, we love nats but the streaming is a must for us, is there a timeline for this? or is not planned at all? we can start with nats and move to nats streaming later if its on the roadmap thanks

fmvin commented 6 years ago

Is there any movement on this issue? We are very interesting in the streaming C or C++98 client. We use a very old-fashioned Linux distro in production and so very limited in alternatives but NATS works fine.

cpowersrbr commented 6 years ago

We are also keen on a C/C++ streaming client. Is there any hint on when one might be available? Edit: Or something for interested parties to contribute to even?

kozlovic commented 6 years ago

@nellson @arifsetiawan @fro0m @santiGoncalves @fmvin @cpowersrbr I understand that you may no longer have interest on that, but if you do, check the PR for NATS C Streaming here.

Also, I am closing this issue and you can follow/comment on the one in the NATS C client repo: https://github.com/nats-io/cnats/issues/140.

Thanks!

kozlovic commented 6 years ago

Just released today as beta release (https://github.com/nats-io/cnats/releases/tag/v1.8.0-beta). If feedback regarding API is ok (or no feedback), then we will get out of beta status. Thanks for your patience and interest in the C client!

kozlovic commented 5 years ago

Wondering if people interested in the NATS Streaming C Client had a chance to evaluate the 1.8.0-beta release. If so, did you find any API design issue that should be addressed before getting out of beta status? If no answer, I may release 1.8.0 this week. Thanks!

vbrunko-voc commented 1 year ago

Wondering if people interested in the NATS Streaming C Client had a chance to evaluate the 1.8.0-beta release. If so, did you find any API design issue that should be addressed before getting out of beta status? If no answer, I may release 1.8.0 this week. Thanks!

I would be interested for this option to be in: Change ClientName (Connection Name) when connecting to JS using NATS from CPP

kozlovic commented 1 year ago

@vbrunko-voc It sounds like you are asking about the C client instead of Go client. Regardless, could you elaborate on this? "I would be interested for this option to be in: Change ClientName (Connection Name) when connecting to JS using NATS from CPP". Note that NATS Streaming is deprecated and new features are unlikely to be implemented.

vbrunko-voc commented 1 year ago

@kozlovic yes sure. The basic idea is that our c-clients written in NATS show up in Grafana/Prometheus as UUIDs. Have no idea what else to change in our source code to give them names in analogy to Go driver e.g.

kozlovic commented 1 year ago

@vbrunko-voc Unfortunately the C client sets the NATS Connection Name to what the provided "client ID" is (in the natsStan_Connect() call). Unless you change your client IDs to have a more meaningful name (maybe as the prefix of your UUIDs), we would need to add a new option to be able to set the NATS connection name. Given that the NATS Streaming project is close to its EOL, not sure if that makes sense. Still, it could be a small addition, low impact, that would be possible to make. First let me know if the workaround described above would work or not. If not, please create an issue in the NATS C client repo so we can track the enhancement request (https://github.com/nats-io/nats.c)

vbrunko-voc commented 1 year ago

Got it, thanks @kozlovic , we'll try the other ways. So, instead of NATS Streaming, what do we left with? JetStream?

derekcollison commented 1 year ago

JetStream is the appropriate path forward yes.