nats-io / nats.c

A C client for NATS
Apache License 2.0
390 stars 137 forks source link

microservices header missing #701

Closed geiseri closed 7 months ago

geiseri commented 11 months ago

Observed behavior

The header micro_args.h is missing from the install files.

Expected behavior

It is added to the install section of src/CMakeLists.txt

Server and client version

release 3.7.0

Host environment

No response

Steps to reproduce

No response

geiseri commented 11 months ago

Noted by the header contents that it is incomplete maybe this is blocking based on completion so feel free to close.

kozlovic commented 11 months ago

@geiseri Since v3.7.0, the service framework was released, so I think this header should have been included indeed, even if there are still TODOs. Will create a PR to address that.

kozlovic commented 11 months ago

@geiseri Actually, having second thoughts. This is used only for the examples, and not sure that it was intended to be library-level APIs. Asking @levb what we should be doing with that header file.

geiseri commented 11 months ago

@kozlovic looking at the internals maybe it should be in the examples directory. The "args format" looks like is specific to the example as it wouldn't have enough of a schema for interop.

levb commented 9 months ago

micro-args was kind of a stop-gap TBH, for examples only. I will move it there.

levb commented 9 months ago

Moving micro_args.* to ./examples would be rather involved since the CMakeLists.txt builds an executable for every .c file.

Moving micro_args.h only, and leaving micro_args.c in ./src can be confusing.

0/5 we should just leave the files where they are, and perhaps replace the use of micro_args in the examples with another, OSS serialization package? Initially I didn't want to pull in the dependencies even for the examples, but using JSON or some other common format would probably be preferred?

@geiseri @kozlovic ?

kozlovic commented 9 months ago

@levb Maybe the "mistake" was to make this example program a bit too configurable ;-). The parameters could have been hard coded, in that the value of the examples was to show how to use the service APIs, not really to be able to run actual fibonnaci or factorial computations :-)

But I would not want to pull a JSON dependency just for that. As you said, we have tried hard to limit the dependencies, so it would be a shame to add one just for the examples. Note that most of the build issues reported by users are around the protobuf (to compile the NATS Streaming client).

levb commented 7 months ago

I agree. For now, I am proposing a PR that moves all this serialization business into a single .h file under examples. Will make Help wanted tickets for more, simpler examples.

geiseri commented 7 months ago

@levb did you make that ticket? I have some ideas on that.