Answer the question
In order to leave comments, you need to log in
How to make service discovery for client applications?
I am following the path of a microservice approach in the front-end. There are already developments, each service in which provides fullstack parts, that is, provides its client part (separate processes that listen to their ports)
Client parts interact via postMessage and are in iframes (thus there is no need to fence something like Web Components and when developing, hot reload works out of the box).
This is launched through docker compose, and in the case of one machine, everything is just on different ports. To implement microservice views on the client side, you need to know where a particular service is located.
The inconvenience is that you need to manually register the ports and in each service specify the host and port by which you need to access another service. Are there any ways close to Auto-discovery like CoteJS, so that such things are solved automatically, and when accessing the service, it is enough to specify its identifier?
Answer the question
In order to leave comments, you need to log in
At the moment, I found a more convenient and simple option for myself:
Docker Swarm + Traefik.
In the existing docker-compose.yml, all I had to do was change build to image, write commands for pre-building images, and add tags for traefik.
Through Swarm, I can deploy scalable containers on several machines, to which (to the desired microservice) Traefik will redirect according to the subdomain (label traefik.frontend.rule=Host:...)
Hashicorp Consul might be right for you? But I use clouds for this, in particular AWS - there their Route53 very conveniently takes care of the issue
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question