Files
msgexchange-v2/src/main/resources/application-dev.yml
T

67 lines
2.7 KiB
YAML
Raw Normal View History

# 开发/影子对拍环境 profileU03/N32 + U07):
# - /env、/beans 放开以便“改值—回读”与装配核验(生产 profile 不加载本文件)
# - msgx.stubs=true:无 MySQL/Redis/Kafka 时以内存 stub 仓储跑通「启动 + 收报 + 主泵/投递循环」
# - msgx.pipeline.autostart=true:启动即拉起 Pump/Dispatcher 专用线程
# 启动:MICRONAUT_ENVIRONMENTS=dev ./gradlew run
msgx:
register-eureka: false
stubs: true
pipeline:
autostart: true
# dev 不注册也不发现(stub):关 eureka discovery,避免 discovery 客户端健康指示器
# 因无 eureka 服务而把 /health 拉成 DOWN
eureka:
client:
discovery:
enabled: false
# DB 仅在真实实装接入后需要;stub 模式不建连——datasources.default.enabled=false 经
# micronaut-jdbc 的 JdbcDataSourceEnabled 条件排除 DataSource bean"stub 不建连"落地);
# 下方 url 仍保留合法默认(host/port/name 分拆,避免占位符默认值内嵌冒号解析坏)。
# 真实接入时:设 MSGX_DB_URL(或 MSGX_DB_HOST/PORT/NAME+ enabled=true。
datasources:
default:
enabled: false
url: jdbc:mysql://${MSGX_DB_HOST:127.0.0.1}:${MSGX_DB_PORT:3306}/${MSGX_DB_NAME:msgexchange_dev}
username: ${MSGX_DB_USER:root}
password: ${MSGX_DB_PASSWORD:}
driver-class-name: com.mysql.cj.jdbc.Driver
# stub 模式无 DataSourceFlyway 显式关闭(主配置默认 enabled:true 只作用于有 DataSource 的环境)
flyway:
datasources:
default:
enabled: false
# stub 模式无真实 Redis/Kafka:关掉 micronaut 自带的 RedisHealthIndicator / KafkaHealthIndicator
# (二者装配需构造真实 client/config;实测未设 MSGX_REDIS_URI / MSGX_KAFKA_SERVERS 时 /health 整体报 500)。
# 健康由自定义 redis-flight-store / kafka-delivery indicator 承担(stub ping=true → UP)。
redis:
health:
enabled: false
kafka:
health:
enabled: false
# stub 无真实 Kafka:仍给 servers 合法默认(Micronaut 占位符默认值内嵌冒号会解析坏,
# 故拆 host/port 两个无冒号默认;字面冒号留在占位符之间)。真实接入时设 MSGX_KAFKA_HOST/PORT。
bootstrap:
servers: ${MSGX_KAFKA_HOST:127.0.0.1}:${MSGX_KAFKA_PORT:9092}
# 管理端点(U03/N32):/env 默认禁用、/beans 默认 enabled+sensitive——dev 显式放开。
# 注意:端点配置前缀是顶层 `endpoints`micronaut.endpoints.* 是死配置,实测不生效)。
endpoints:
env:
enabled: true
sensitive: false
beans:
enabled: true
sensitive: false
health:
details-visible: ANONYMOUS # dev 排障:无鉴权也显示各 indicator 明细(生产不加载本文件)
micronaut:
server:
port: 8080