Replies: 2 comments 1 reply
-
Have you looked at the integration tests in the client? We run one or more servers from code for each test suite. I do think that this would be extremely useful in it's own repo that other projects could access via nuget. We have the exact same idea for java (https://github.com/nats-io/java-nats-server-runner) |
Beta Was this translation helpful? Give feedback.
-
The java starts an external process. Same with the .net one. Take a look at this: https://github.com/nats-io/nats.net/blob/master/src/Tests/IntegrationTests/TestUtilities.cs I think the best thing is for you to build your project however you want in your github org and we can add it to this page: https://nats.io/download/#connectors-and-utilities |
Beta Was this translation helpful? Give feedback.
-
Hi I'm currently experimenting with creating an embedded nats server for dotnet via a multiplatform nuget package that contains native binaries for the nats server (linux amd64 and winx64 for now)
I'm sure that this is not something for this repo, since its a client and pretty slim atm, but there could be synergies going forward, especially if find a way to use the client via a in process pipe, sort of like how the go client is able to connect directly.
So why am I posting here, mostly to hear if this is something that others have a need for, and if that's the case I'll make the stuff public and hopefully have some more experienced nats / go guys help out.
What I have so far is a small go package that uses the nats server package and exposes some simple methods, that in turn is compiled to a.so and.dll utilizing go's cgo capabilities (go builmode=c-shared) and packed in a multiplatform dotnet nuget package.
This let's me have nats-server in-process wrapped in a Nats Server class to hide away the ffi part :)
NOTE: For now I've just exposed enough to:
This is an extract from the generated c header
For now I use the nats client for all management etc so still going over a socket, but loopback
This is an example on how I use my Nats Server class in a console test app in c#
Beta Was this translation helpful? Give feedback.
All reactions