chore: wire redis session config for ingress
This commit is contained in:
@@ -29,6 +29,11 @@ x-common-env: &common-env
|
|||||||
MYSQL_JDBC_URL: ${MYSQL_JDBC_URL:-}
|
MYSQL_JDBC_URL: ${MYSQL_JDBC_URL:-}
|
||||||
MYSQL_USERNAME: ${MYSQL_USERNAME:-}
|
MYSQL_USERNAME: ${MYSQL_USERNAME:-}
|
||||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-}
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-}
|
||||||
|
REDIS_HOST: ${REDIS_HOST:-r-bp1u741kij7e51i481pd.redis.rds.aliyuncs.com}
|
||||||
|
REDIS_PORT: ${REDIS_PORT:-6379}
|
||||||
|
REDIS_DATABASE: ${REDIS_DATABASE:-50}
|
||||||
|
REDIS_USERNAME: ${REDIS_USERNAME:-}
|
||||||
|
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
||||||
|
|
||||||
services:
|
services:
|
||||||
gb32960-ingest-app:
|
gb32960-ingest-app:
|
||||||
@@ -167,11 +172,6 @@ services:
|
|||||||
MYSQL_JDBC_URL: ${MYSQL_JDBC_URL:-}
|
MYSQL_JDBC_URL: ${MYSQL_JDBC_URL:-}
|
||||||
MYSQL_USERNAME: ${MYSQL_USERNAME:-}
|
MYSQL_USERNAME: ${MYSQL_USERNAME:-}
|
||||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-}
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-}
|
||||||
REDIS_HOST: ${REDIS_HOST:-}
|
|
||||||
REDIS_PORT: ${REDIS_PORT:-6379}
|
|
||||||
REDIS_DATABASE: ${REDIS_DATABASE:-50}
|
|
||||||
REDIS_USERNAME: ${REDIS_USERNAME:-}
|
|
||||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
|
||||||
ports:
|
ports:
|
||||||
- "${VEHICLE_ANALYTICS_HTTP_PORT:-20300}:20300"
|
- "${VEHICLE_ANALYTICS_HTTP_PORT:-20300}:20300"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ Authorization failures are rejected before the Kafka durability boundary and can
|
|||||||
|
|
||||||
- Java 25 and Maven available on PATH.
|
- Java 25 and Maven available on PATH.
|
||||||
- Local Kafka reachable at `127.0.0.1:9092`, plus Kafka CLI tools such as `kafka-topics` and optionally `kafka-console-consumer`.
|
- Local Kafka reachable at `127.0.0.1:9092`, plus Kafka CLI tools such as `kafka-topics` and optionally `kafka-console-consumer`.
|
||||||
|
- Production GB32960/JT808 session state uses Redis by default. For local
|
||||||
|
one-process smoke tests without Redis, set `SESSION_STORE=memory` explicitly.
|
||||||
- No repository-local Kafka bootstrap script or compose file was found during Task 8 verification on 2026-06-23.
|
- No repository-local Kafka bootstrap script or compose file was found during Task 8 verification on 2026-06-23.
|
||||||
|
|
||||||
If your shell needs an explicit JDK:
|
If your shell needs an explicit JDK:
|
||||||
@@ -54,12 +56,13 @@ export PATH="$JAVA_HOME/bin:/opt/homebrew/bin:$PATH"
|
|||||||
From the repository root:
|
From the repository root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mvn -pl :gb32960-ingest-app,:vehicle-history-app,:vehicle-analytics-app -am package -Dmaven.test.skip=true
|
mvn -pl :gb32960-ingest-app,:jt808-ingest-app,:vehicle-history-app,:vehicle-analytics-app -am package -Dmaven.test.skip=true
|
||||||
```
|
```
|
||||||
|
|
||||||
Expected result: `BUILD SUCCESS` and these runnable jars:
|
Expected result: `BUILD SUCCESS` and these runnable jars:
|
||||||
|
|
||||||
- `modules/apps/gb32960-ingest-app/target/gb32960-ingest-app.jar`
|
- `modules/apps/gb32960-ingest-app/target/gb32960-ingest-app.jar`
|
||||||
|
- `modules/apps/jt808-ingest-app/target/jt808-ingest-app.jar`
|
||||||
- `modules/apps/vehicle-history-app/target/vehicle-history-app.jar`
|
- `modules/apps/vehicle-history-app/target/vehicle-history-app.jar`
|
||||||
- `modules/apps/vehicle-analytics-app/target/vehicle-analytics-app.jar`
|
- `modules/apps/vehicle-analytics-app/target/vehicle-analytics-app.jar`
|
||||||
|
|
||||||
@@ -71,12 +74,15 @@ Run these only after Kafka is reachable at `127.0.0.1:9092`:
|
|||||||
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.raw.gb32960.v1 --partitions 12 --replication-factor 1
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.raw.gb32960.v1 --partitions 12 --replication-factor 1
|
||||||
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.event.gb32960.v1 --partitions 12 --replication-factor 1
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.event.gb32960.v1 --partitions 12 --replication-factor 1
|
||||||
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.dlq.gb32960.v1 --partitions 3 --replication-factor 1
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.dlq.gb32960.v1 --partitions 3 --replication-factor 1
|
||||||
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.raw.jt808.v1 --partitions 12 --replication-factor 1
|
||||||
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.event.jt808.v1 --partitions 12 --replication-factor 1
|
||||||
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --create --if-not-exists --topic vehicle.dlq.jt808.v1 --partitions 3 --replication-factor 1
|
||||||
```
|
```
|
||||||
|
|
||||||
Optional sanity check:
|
Optional sanity check:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kafka-topics --bootstrap-server 127.0.0.1:9092 --list | grep -E 'vehicle\.(raw|event|dlq)\.gb32960\.v1'
|
kafka-topics --bootstrap-server 127.0.0.1:9092 --list | grep -E 'vehicle\.(raw|event|dlq)\.(gb32960|jt808)\.v1'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start Split Services Locally
|
## Start Split Services Locally
|
||||||
@@ -89,10 +95,22 @@ GB32960 ingest:
|
|||||||
KAFKA_BROKERS=127.0.0.1:9092 \
|
KAFKA_BROKERS=127.0.0.1:9092 \
|
||||||
GB32960_PORT=32960 \
|
GB32960_PORT=32960 \
|
||||||
HTTP_PORT=20100 \
|
HTTP_PORT=20100 \
|
||||||
|
SESSION_STORE=memory \
|
||||||
java --sun-misc-unsafe-memory-access=allow \
|
java --sun-misc-unsafe-memory-access=allow \
|
||||||
-jar modules/apps/gb32960-ingest-app/target/gb32960-ingest-app.jar
|
-jar modules/apps/gb32960-ingest-app/target/gb32960-ingest-app.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
JT808 ingest:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
KAFKA_BROKERS=127.0.0.1:9092 \
|
||||||
|
JT808_PORT=808 \
|
||||||
|
HTTP_PORT=20400 \
|
||||||
|
SESSION_STORE=memory \
|
||||||
|
java --sun-misc-unsafe-memory-access=allow \
|
||||||
|
-jar modules/apps/jt808-ingest-app/target/jt808-ingest-app.jar
|
||||||
|
```
|
||||||
|
|
||||||
Vehicle history:
|
Vehicle history:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -120,6 +138,7 @@ To enable the latest-state API in analytics, also set `VEHICLE_STATE_ENABLED=tru
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sS http://127.0.0.1:20100/actuator/health
|
curl -sS http://127.0.0.1:20100/actuator/health
|
||||||
|
curl -sS http://127.0.0.1:20400/actuator/health
|
||||||
curl -sS http://127.0.0.1:20200/actuator/health
|
curl -sS http://127.0.0.1:20200/actuator/health
|
||||||
curl -sS http://127.0.0.1:20300/actuator/health
|
curl -sS http://127.0.0.1:20300/actuator/health
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ spring:
|
|||||||
threads:
|
threads:
|
||||||
virtual:
|
virtual:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
|
port: ${REDIS_PORT:6379}
|
||||||
|
username: ${REDIS_USERNAME:}
|
||||||
|
password: ${REDIS_PASSWORD:}
|
||||||
|
database: ${REDIS_DATABASE:50}
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: ${HTTP_PORT:20100}
|
port: ${HTTP_PORT:20100}
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class Gb32960IngestAppDefaultsTest {
|
|||||||
"spring.config.import[0]",
|
"spring.config.import[0]",
|
||||||
"optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}")
|
"optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}")
|
||||||
.containsEntry("spring.cloud.nacos.config.server-addr", "${NACOS_SERVER_ADDR:127.0.0.1:8848}")
|
.containsEntry("spring.cloud.nacos.config.server-addr", "${NACOS_SERVER_ADDR:127.0.0.1:8848}")
|
||||||
|
.containsEntry("spring.data.redis.host", "${REDIS_HOST:127.0.0.1}")
|
||||||
|
.containsEntry("spring.data.redis.port", "${REDIS_PORT:6379}")
|
||||||
|
.containsEntry("spring.data.redis.database", "${REDIS_DATABASE:50}")
|
||||||
.containsEntry("lingniu.ingest.gb32960.enabled", true)
|
.containsEntry("lingniu.ingest.gb32960.enabled", true)
|
||||||
.containsEntry("lingniu.ingest.gb32960.server.enabled", true)
|
.containsEntry("lingniu.ingest.gb32960.server.enabled", true)
|
||||||
.containsEntry("lingniu.ingest.gb32960.port", "${GB32960_PORT:32960}")
|
.containsEntry("lingniu.ingest.gb32960.port", "${GB32960_PORT:32960}")
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ spring:
|
|||||||
threads:
|
threads:
|
||||||
virtual:
|
virtual:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
|
port: ${REDIS_PORT:6379}
|
||||||
|
username: ${REDIS_USERNAME:}
|
||||||
|
password: ${REDIS_PASSWORD:}
|
||||||
|
database: ${REDIS_DATABASE:50}
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: ${HTTP_PORT:20400}
|
port: ${HTTP_PORT:20400}
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class Jt808IngestAppDefaultsTest {
|
|||||||
"spring.config.import[0]",
|
"spring.config.import[0]",
|
||||||
"optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}")
|
"optional:nacos:${spring.application.name}.${NACOS_CONFIG_FILE_EXTENSION:yml}?group=${NACOS_GROUP:DEFAULT_GROUP}&refreshEnabled=${NACOS_REFRESH_ENABLED:true}")
|
||||||
.containsEntry("spring.cloud.nacos.config.server-addr", "${NACOS_SERVER_ADDR:127.0.0.1:8848}")
|
.containsEntry("spring.cloud.nacos.config.server-addr", "${NACOS_SERVER_ADDR:127.0.0.1:8848}")
|
||||||
|
.containsEntry("spring.data.redis.host", "${REDIS_HOST:127.0.0.1}")
|
||||||
|
.containsEntry("spring.data.redis.port", "${REDIS_PORT:6379}")
|
||||||
|
.containsEntry("spring.data.redis.database", "${REDIS_DATABASE:50}")
|
||||||
.containsEntry("server.port", "${HTTP_PORT:20400}")
|
.containsEntry("server.port", "${HTTP_PORT:20400}")
|
||||||
.containsEntry("lingniu.ingest.jt808.enabled", true)
|
.containsEntry("lingniu.ingest.jt808.enabled", true)
|
||||||
.containsEntry("lingniu.ingest.jt808.port", "${JT808_PORT:808}")
|
.containsEntry("lingniu.ingest.jt808.port", "${JT808_PORT:808}")
|
||||||
|
|||||||
Reference in New Issue
Block a user