https://github.com/starwit/sae-database-writer
A redis/valkey client, that stores all SAE data into a database.
https://github.com/starwit/sae-database-writer
sae vision-api
Last synced: 5 months ago
JSON representation
A redis/valkey client, that stores all SAE data into a database.
- Host: GitHub
- URL: https://github.com/starwit/sae-database-writer
- Owner: starwit
- License: agpl-3.0
- Created: 2023-06-03T17:53:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-15T10:31:49.000Z (9 months ago)
- Last Synced: 2025-09-15T12:24:09.242Z (9 months ago)
- Topics: sae, vision-api
- Language: Java
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Database writer for Vision API
This repo implements a Valkey/Redis client, that can receive and parse Vision API messages and then writes the serialized messages in JSON format into a Postgres database. It attaches to multiple Valkey streams. Currently, message types `SAE`, `POSITION` and `DETECTION_COUNT` are supported.
On application start the database schema is created / validated using Flyway.
This component is part of the Starwit Awareness Engine (SAE). See umbrella repo here: https://github.com/starwit/starwit-awareness-engine
## Development
- Add vision-api package repository to your Maven config, as described [here](https://github.com/starwit/vision-api#java--maven)
- `deployment` contains a docker compose file that can be used to start the necessary database and valkey instances
- Use sae-tools / a running SAE instance to write interesting messages onto the configured streams
```sh
# Start database and Valkey instance (in deployments)
docker compose up
# Start saedump playback (in starwit-awareness-engine/tools/sae-introspection)
# You can use the short exemplary dumpfile src/test/resources/test_positionsource.saedump
poetry run python play.py --fixed-interval 1s --adjust-timestamps
# Run database-writer (and log messages)
LOGGING_LEVEL_DE_STARWIT=debug mvn spring-boot:run
# Look at database entries arriving
watch "docker compose exec db psql -U postgres database_writer -P pager=off -c 'SELECT * FROM messages order by id desc limit 1'"
```
## Configuration
See `application.properties` for available configuration values.
## Debugging
The log level of the relevant parts can be set through the Spring Boot property `LOGGING_LEVEL_DE_STARWIT`, default is `info`.