erp-java/nacos/examples/shared-config/common-config.yaml

101 lines
2.7 KiB
YAML

# ==============================================================
# Nacos 共享配置 - common-config.yaml
# 所有微服务共享的配置
# ==============================================================
spring:
# Jackson 配置
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Shanghai
serialization:
write-dates-as-timestamps: false
fail-on-empty-beans: false
deserialization:
fail-on-unknown-properties: false
# HTTP 配置
http:
encoding:
charset: UTF-8
enabled: true
force: true
# ==============================================================
# Actuator 公共配置
# ==============================================================
management:
endpoints:
web:
exposure:
include: health,info,metrics,env,prometheus
base-path: /actuator
endpoint:
health:
show-details: always
metrics:
tags:
application: ${spring.application.name}
# ==============================================================
# 日志公共配置
# ==============================================================
logging:
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}] %-5level %logger{36} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}] %-5level %logger{36} - %msg%n"
level:
root: INFO
com.erp: DEBUG
org.springframework: INFO
org.springframework.cloud.alibaba.nacos: INFO
com.alibaba.nacos: INFO
# ==============================================================
# OpenFeign 配置
# ==============================================================
feign:
client:
config:
default:
connectTimeout: 10000
readTimeout: 30000
loggerLevel: basic
compression:
request:
enabled: true
response:
enabled: true
# ==============================================================
# Resilience4j 熔断器配置
# ==============================================================
resilience4j:
circuitbreaker:
instances:
default:
slidingWindowSize: 10
failureRateThreshold: 50
waitDurationInOpenState: 10s
permittedNumberOfCallsInHalfOpenState: 3
retry:
instances:
default:
maxAttempts: 3
waitDuration: 500ms
enableExponentialBackoff: true
exponentialBackoffMultiplier: 2
# ==============================================================
# Swagger/API文档配置
# ==============================================================
springdoc:
api-docs:
enabled: true
path: /v3/api-docs
swagger-ui:
enabled: true
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha