can I access to microservice with someting like this: Eureka Server: http://localhost:8761/ Microservice url: http://localhost:8080/ Call to Microservice to be something like: http://localhost:8761/name-service/ Is it posible? When i open the eureka server the service is registered.
eureka/application.properties:
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
logging.level.com.netflix.eureka=OFF
logging.level.com.netflix.discovery=OFF
name-service/application.properties
spring.application.name=name-service
server.port=8080
How can i achieve this?
Eureka provides service discovery in a microservices architecture. This involves two steps on a high level: Services registers themselves on the Eureka server and details like name, host, and port are stored there. Details of other registered microservices become available for the registered service.
A short answer Yes, you can survive with Spring Cloud API Gateway and no Service Discovery. But it's really dependent on the size of your application and the amount of traffic it will be handling. You can start migration to microservices without Service discovery.
Eureka Server: It is an application that contains information about all client service applications. Each microservice is registered with the Eureka server and Eureka knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.
The functionality you look for can be achieved using netflix zuul + netflix eureka. "name-service" is the name of your service with which you registered to eureka server. You should be hitting ZUUL microproxy address; not the eureka address
I suggest you start from here. https://spring.io/blog/2015/01/20/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka . This is a nice article by Josh Long
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With