Closed ghost closed 6 years ago
No. The microservice only communicates with Resgate(s) through NATS server. In a similar way, Resgates has no knowledge of any microservces. It sends requests blindly and awaits answers.
Resgate only does WebSockets and HTTP towards client. Microservices doesn't need any of that.
Yes. A microservice can be written in any language which has supported NATS clients. Go is a very good choice!
A go-service has been added to the docs, containing a Go version of the Hello World service example.
No. Resgate currently only provides a data API. While it also runs a HTTP server, it only uses it to provide resources in a REST like manner.
But it does not serve static files, at least not in the current version. It is however something that should be considered! It would be especially useful for files that requires access, as you mentioned.
The microservice handling the static files for the frontend needs to run its own HTTP server. An nginx (or some other reverse proxy) would indeed be needed.
Ah ok.
So I was playing with from JS Microservice and GUI examples. They both call NATS directly. For the client are you encapsulating the NATS protocol inside websockets then ?
On Thu, 12 Jul 2018, 00:07 Samuel Jirénius, notifications@github.com wrote:
Does RES gate support microservice interfacing
No. The microservice only communicates with Resgate(s) through NATS server. In a similar way, Resgates has no knowledge of any microservces. It sends requests blindly and awaits answers.
Resgate only does WebSockets and HTTP towards client. Microservices doesn't need any of that. Can a Microservice use the golant NATS driver instead?
Yes. A microservice can be written in any language which has supported NATS clients https://nats.io/download/. Go is a very good choice!
A go-service https://github.com/jirenius/resgate/tree/master/docs/go-service has been added to the docs, containing a Go version of the Hello World service example. Can Resgate provide a web GUI?
No. Resgate currently only provides a data API. While it runs a HTTP server, it only uses it to provide resources in a REST like manner. But it does not serve static files, at least not in the current version. It is however something that should be considered! It would be especially for files that requires access, as you mention.
The microservice handling the static files for the frontend needs to run its own HTTP server. An nginx (or some other reverse proxy) would indeed be needed.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jirenius/resgate/issues/27#issuecomment-404326023, or mute the thread https://github.com/notifications/unsubscribe-auth/ATuCwoT-1Vini3vEpAUgRhF0vdoZoICqks5uFnc2gaJpZM4VK2VH .
@gedw99 How do you mean both call NATS directly?
Only the microservices and ResGate connect to NATS, communicating with one another using the RES-Service protocol on top of NATS internal protocol. A client, using ResClient, never communicates directly with NATS. It communicates with Resgate, using the RES-Client protocol over WebSockets.
Can you give an example of the traffic you refer to?
my mistake
https://github.com/jirenius/resgate-test-app/blob/master/microservice/ticker.js
https://github.com/jirenius/resgate-test-app/blob/master/src/module/tab/ticker/Ticker.js
Let me knwo if i got this right :)
True!
Each file in microservice/
is a stand alone Node.js microservice.
All files under src/
are part of the client.
Ticker.js
is the client javascript that depends on microservice/ticker.js
.
Not that a client modules actually knows which service provides the resources. Like Viewer.js
, it can generically display any resource from any service.
Confusing when everything is written in Javascript ;).
And the resgate-test-app wasn't written primarily for reference. A proper website with examples would be more appropriate.
thanks @jirenius . Getting the hang of it... Will close this..
Does the RES gateway support a typical Microservice interfacing with it over http ? As opposed to using the golang NATS client.
If yes, does the Microservice need to support websockets ? I presume a definite yes.
Additionally can a Microservice also use the golang NATS drivers instead. There are certain use cases where that prefer that.
Also if I have a Microservice that needs to provide web GUI to the browser can the RES gateway be used for it ? I presume yes. It would mean I don't need a sperate reverse proxy & the security is all applied unifoly at the RES gateway level. It also means that I only have to run a single docker of my web service that also provides the web rendering.
Lastly .. there is no lastly. That's alot of questions ..