chore: wire redis session config for ingress

This commit is contained in:
lingniu
2026-07-01 03:06:42 +08:00
parent f889f1400d
commit 293d75dc96
6 changed files with 46 additions and 7 deletions

View File

@@ -40,6 +40,8 @@ Authorization failures are rejected before the Kafka durability boundary and can
- 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`.
- 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.
If your shell needs an explicit JDK:
@@ -54,12 +56,13 @@ export PATH="$JAVA_HOME/bin:/opt/homebrew/bin:$PATH"
From the repository root:
```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:
- `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-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.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.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:
```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
@@ -89,10 +95,22 @@ GB32960 ingest:
KAFKA_BROKERS=127.0.0.1:9092 \
GB32960_PORT=32960 \
HTTP_PORT=20100 \
SESSION_STORE=memory \
java --sun-misc-unsafe-memory-access=allow \
-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:
```bash
@@ -120,6 +138,7 @@ To enable the latest-state API in analytics, also set `VEHICLE_STATE_ENABLED=tru
```bash
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:20300/actuator/health
```