Spring cloud (IX): common configuration parameters of each component
1. Common configurations of Eureka
Eureka Server end
Eureka.server.enable-self-preservation # set to false, turn off self-protection
Eureka.server.eviction-interval-timer-in-ms # cleanup interval (in milliseconds, default is 60 to 1000)
Eureka.environment=dev # specify the environment
Eureka.datacenter=cloud designated data Center
Eureka Client end
Eureka.client.healthcheck.enabled # enable health check (spring-boot-starter-actuator dependency is required)
Eureka.instance.lease-renewal-interval-in-seconds # renewal update interval (default 30 seconds)
Eureka.instance.lease-expiration-duration-in-seconds # Renewal Expiration time (default 90 seconds)
Eureka.instance.preferIpAddress=true
Eureka.instance.instance-id=$ {spring.cloud.client.ipAddress}: ${server.port} # sets Instance ID to the form of IP: Port
There is no need for eureka.client.registerWithEureka=false # eureka services to register themselves
Eureka.client.fetchRegistry=false # # eureka service does not need to pull its own registration information
2. Use feign to integrate swagger
The access to the api interface timed out and the attribute needs to be modified:
# Inter-service call timeout
Hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000
3. Summary
The above parameter configuration is commonly used in the project, through these parameter configuration can be simple and clear to know that the server is registered with the registry, the other can use the default, unless some functions in the project must modify the configuration, to consider changing.