I created a sample Spring Cloud microservice by using Eureka server and Zuul Spring Cloud tools in my local system. It runs properly. I registered my microservice as client at eureka server project. And also registered my Zuul as client at Eureka server.
The below is my Eureka server project application.properties,
server.port=8071
eureka:
numberRegistrySyncRetries: 1
instance:
hostname: localhost
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://localhost:8071/eureka/
server:
enable-self-preservation: true
And the below code is my microservice application.property file content,
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
And My zuul application.properties code is,
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/
eureka.client.register-with-eureka=true
eureka.client.fetch-registry=true
spring.application.name=eurekaZuulClient
ribbon.eureka.enabled=true
zuul:
routes:
espace-service:
path: /espace/**
stripPrefix: true
serviceId: espace-service
server.port=8090
Here my doubt is that when we deploying this application into cloud, What change we need to make in application.properties?, since we don't know about server.port and "eureka.client.serviceUrl.defaultZone" at cloud.Here I only running with localhost.
So how we need to follow cloud deployment procedure in configuration? I am beginner with Spring Cloud, and I have lot of confusions in these configuration.