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
The protobuf-c and ssh libraries are looked for when using the cnats static library. #678
Comments
@li1786422 Are you observing this when linking the example apps? There was a recent conversation about it in the #C channel on Slack. A quick workaround could be: if you are not using the now-deprecated NATS Streaming (aka STAN), you can compile with - |
@li1786422 Did my suggestion above work for you? |
ok I will try it |
but jetstream also use libprotobuf-c to encode |
please nat-c have the ues of key-value example? |
@li1786422 No, JetStream does not need libprotobuf-c, the protocols are JSON.
We don't have examples per-se, but you could have a look at the tests, this should give you all the help you need. Check tests that start with |
ok |
Is it possible to set the lifetime of a message on jetstream, I only found a MaxAge in the jetStreamConfig but I don't know if it's relevant. |
@li1786422 No, you cannot set a TTL per-message. It is only at the stream level. |
|
@li1786422 You will find more information about the stream configuration here. MaxAge is the time to live of messages in the stream expressed in nanoseconds (this comes from Go time.Duration that is an int64 and the unit is nanoseconds). |
Thanks Sorry I only looked in the source code and didn't find that explanation.
|
Please use js_SubscribeSync(&sub, js, subj, &jsOpts, NULL, NULL); to subscribe to a topic, and after that subscribe to a topic by while(1){
} |
@li1786422 I am not sure I understand your question. Are you saying that messages "1, 2, 3, 4, 5" are in the stream and using the code above you don't see messages "1, 2, 3, 4, 5" being received? We would need to see the content of the subscribe options to see for instance if you have created a queue (and have multiple instances running) instead of a regular consumer, or if you have a MaxAckWait that is way too small (smaller than your sleep interval) that then causes the server to redeliver messages. Also, I would prefer that either we close this issue (related to CMake) if the original problem is somehow addressed and that you open new issues when dealing with different questions/issues. Is that ok? |
|
Closing since the original issue is resolved, and the new ticket filed |
What version were you using?
natsclient 3.61
What environment was the server running in?
Static libraries generated by vs code cmake on windows using the visio studio 2022 compiler (for x64 architectures).
Is this defect reproducible?
When using the cnats static library, the link will look for protobuf-c libraries, and when generating the cnats library, the static library of protobuf-c is used.
Given the capability you are leveraging, describe your expectation?
Use the cnats library without relying on any other libraries.
Given the expectation, what is the defect you are observing?
Problems with static library generation mechanism under windows or cmake writing
The text was updated successfully, but these errors were encountered: