chore(infra): 增加本地中间件编排、环境配置与 Kafka 降级支持

This commit is contained in:
windyboy
2026-09-07 15:11:06 +08:00
parent abacd6a3f4
commit dc68f1e1f8
5 changed files with 217 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
# =====================================================================
# msgexchange-v2 本地开发环境变量示例(ACM2-13 口径)
# 复制为 .env 或直接在本地启动时 export
# =====================================================================
# 1. 共享信箱 MySQLdev compose: mysql 服务)
MSGX_MAILBOX_URL=jdbc:mysql://localhost:3306/cdairport?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8mb4
MSGX_MAILBOX_USER=msgx_dev
MSGX_MAILBOX_PASSWORD=msgx_dev_pass
# 2. 自有 PostgreSQLdev compose: postgres 服务,Flyway V1.0.0 自动建表)
MSGX_PG_URL=jdbc:postgresql://localhost:5432/msgx
MSGX_PG_USER=msgx_dev
MSGX_PG_PASSWORD=msgx_dev_pass
# 3. Redis / Valkeydev compose: redis 服务,航班动态 + 快照 gen)
MSGX_REDIS_URI=redis://localhost:6379
# 4. Kafkadev compose: kafka 单节点 KRaft 服务,或对接现网/测试网)
MSGX_KAFKA_SERVERS=localhost:9092
# --- 旧版 Kafka Broker 兼容配置(如现网 0.10.x / 1.x 无 INIT_PRODUCER_ID 协议时启用)---
# 现代 Kafka3.x/4.x,如本地 compose):默认 acks=all, idempotence=true, max-in-flight=5
# 旧版 Kafka0.10.x/1.x):取消注释以下三行以触发兼容降级,防止 UnsupportedVersionException
# MSGX_KAFKA_ACKS=1
# MSGX_KAFKA_IDEMPOTENCE=false
# MSGX_KAFKA_MAX_IN_FLIGHT=1