Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Spring cloud (IX): common configuration parameters of each component

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report