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

75 lines
3.2 KiB
YAML
Raw Normal View History

# 开发/影子对拍环境 profileU03/N32 + U07):
# - /env、/beans 放开以便“改值—回读”与装配核验(生产 profile 不加载本文件)
# - msgx.stubs=true:无 MySQL/Redis/Kafka 时以内存 stub 跑通「启动 + compat HTTP 写 +
# 主泵/投递循环」(生产主路径 JDBC 轮询 InboxPoller 属 U05stub 未覆盖)
# - 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 不建连"落地)。
# 遵循 ACM2-12/ACM2-13 自有数据库(PostgreSQL)口径。真实接入时:设 MSGX_PG_URL + enabled=true。
datasources:
default:
enabled: false
url: jdbc:postgresql://${MSGX_PG_HOST:127.0.0.1}:${MSGX_PG_PORT:5432}/${MSGX_PG_NAME:msgx}
username: ${MSGX_PG_USER:msgx_dev}
password: ${MSGX_PG_PASSWORD:msgx_dev_pass}
driver-class-name: org.postgresql.Driver
# 共享信箱 MySQL 适配配置(ACM2-12/ACM2-13):
mailbox:
shared-mysql:
enabled: false
url: jdbc:mysql://${MSGX_MAILBOX_HOST:127.0.0.1}:${MSGX_MAILBOX_PORT:3306}/${MSGX_MAILBOX_NAME:cdairport}?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8mb4
username: ${MSGX_MAILBOX_USER:msgx_dev}
password: ${MSGX_MAILBOX_PASSWORD:msgx_dev_pass}
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