添加 Kafka 消费者、数据库写入、Redis 集成等核心模块,实现设备上下线事件处理 - 创建项目基础目录结构与配置文件 - 实现 Kafka 消费逻辑与手动提交偏移量 - 添加 PostgreSQL 数据库连接与分区表管理 - 集成 Redis 用于错误队列和项目心跳 - 包含数据处理逻辑,区分重启与非重启数据 - 提供数据库初始化脚本与分区创建工具 - 添加单元测试与代码校验脚本
32 lines
685 B
Plaintext
32 lines
685 B
Plaintext
# Server Configuration
|
|
PORT=3001
|
|
NODE_ENV=development
|
|
|
|
# Kafka Configuration
|
|
KAFKA_BROKERS=localhost:9092
|
|
KAFKA_TOPIC=blwlog4Nodejs-rcu-onoffline-topic
|
|
KAFKA_GROUP_ID=bls-onoffline-group
|
|
KAFKA_CLIENT_ID=bls-onoffline-client
|
|
KAFKA_CONSUMER_INSTANCES=1
|
|
# KAFKA_SASL_USERNAME=
|
|
# KAFKA_SASL_PASSWORD=
|
|
# KAFKA_SASL_MECHANISM=plain
|
|
|
|
# Database Configuration (PostgreSQL)
|
|
DB_HOST=localhost
|
|
DB_PORT=5432
|
|
DB_USER=postgres
|
|
DB_PASSWORD=password
|
|
DB_DATABASE=log_platform
|
|
DB_SCHEMA=public
|
|
DB_TABLE=onoffline_record
|
|
DB_MAX_CONNECTIONS=10
|
|
|
|
# Redis Configuration
|
|
REDIS_HOST=localhost
|
|
REDIS_PORT=6379
|
|
REDIS_PASSWORD=
|
|
REDIS_DB=0
|
|
REDIS_PROJECT_NAME=bls-onoffline
|
|
REDIS_API_BASE_URL=http://localhost:3001
|