Can i programatically obtain services metadata/name/url in Spring Cloud? - spring

Is it possible to programatically display all of the services (names + URL) of the services registered to Eureka service registry and is it possible to do the same for API gateway (Zuul) registered to any Eureka service registry (for example i suppose it is possible to read this metadata from the ApplicationContext)?

Related

Services registered in Jhipster registry, but gateway cannot route requests

My Services are being registered on jhipster-registry. As can be seen below:
As you can see, Canoja service and Gateway are registered in my service registry.
And as per the documentation:
The gateway will automatically proxy all requests to the microservices, using their application name: for example, when microservices app1 is registered, it is available on the gateway on the /services/app1 URL.
I was expecting the gateway to pull my service APIs automatically. But, my APIs are not available in the gateway:
I had the same problem, apparently the problem was with the names of the registered microservices (they were too long).
I was using a generated gateway that was generated using JHipster 7.9.3, and a registry version 7.4.0, and all the microservices were created using jhipster 7.9.3 as well.
Sadly, i cannot provide any logs whatsoever because the gateway was displaying no logs whatsoever, just the fact that it fails to route because no instance of the called service was found.
TLDR: try to make each service name between 3 to 8 characters and no special characters.

Spring boot micro service Deployment

I am new to Micro services architecture.. I want know if it is required to deploy all Spring boot micro services in the same local network ..? As Eureka Discovery service uses Private/Internal IP Address for Registration , i am unable to call a services from another service deployed in different local network...
Please let me know how micro services deployed across multiple Sub nets should communicate each other in this case
or is there a way to tell eureka to use only public IP Address..?
Not sure if this would help, but by default, your eureka client will try to connect to the default localhost:8761 where the eureka discovery server should exist.
In case you have a different location for your discovery-service you can use the following in the application.properties file in your client services.
eureka.client.service-url.defaultZone=http://{address}-{port}/eureka

Fetch docker container name of microservices registered with the Eureka server

Does the Eureka server have information on container image names for registered applications? I am working on a spring-boot microservices application in which it is necessary to get image names during registration or subsequent health checks. Eureka server can provide a lot of information about the application registered (using the InstanceInfo object), but there is no information such as container/image name. Or would it be possible to query application metadata for such information? Or is there any other approach that can be use din achieving this task?

Spring Boot Admin server on Cloud Foundry with SimpleDiscoveryClient

I am trying to setup a Spring Boot Admin server on a Cloud foundry. I am using the client Spring Cloud Discovery with SimpleDiscoveryClient configuration. We are not having any Thrid Party service discovery client like eureka. I can see the service getting registered to the spring boot admin server. But when i scale up any service, i see only one instance of that service and the actual number of instances are not reflected. I would like to know if that is possible without Eureka or any other service discovery, if yes how to achieve that without them.
Thanks

eureka force service registration from application.yml

I want to register in my Eureka instance a ElasticSearch service (and some others) with a hardcoded IP.
The idea here is that my other services (like Zuul) could access those services using ribbon.
It would be optimal to set those services in my Eureka's application.yml
Is it possible? And how?
It is not a feature that eureka supports.

Resources