V
V
Vitaly Stolyarov2018-11-11 19:58:43
Service Oriented Architecture
Vitaly Stolyarov, 2018-11-11 19:58:43

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

2 answer(s)
V
Vitaly Stolyarov, 2018-11-23
@Ni55aN

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:...)

I
Ivan Shumov, 2018-11-11
@inoise

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 question

Ask a Question

731 491 924 answers to any question