This directory contains a Docker-based implementation of the SCGPS telemetry data sinker for PostgreSQL with PostGIS extension. The service consumes telemetry events from Kafka and stores them in PostgreSQL database with optimized geospatial support.
docker-compose.yaml-sample to docker-compose.yaml
docker-compose.yaml-sample from the official repository:
examples/pg_sinker_docker on GitLabdocker-compose.yamldocker-compose up -d
The image can be pinned by tag or digest (for example scgps/scgps-pg-sinker:2.1.0) for deterministic deployments.
| Parameter | Description | Source | Required |
|---|---|---|---|
KAFKA_BOOTSTRAP_SERVERS | Kafka broker endpoints | Provided by SCGPS | Yes |
KAFKA_SASL_USER | SASL authentication username | Provided by SCGPS | Yes |
KAFKA_SASL_PASS | SASL authentication password | Provided by SCGPS | Yes |
KAFKA_CONSUMER_GROUP_ID | Consumer group identifier | User defined | Yes |
KAFKA_PARTNER_TOPIC_LIST | Comma-separated list of topics to consume | Provided by SCGPS | Yes |
KAFKA_PROVIDER | Kafka endpoint trust source: aws, ovh, or none | Provided by SCGPS | No, omit for default trust |
KAFKA_SSL_CA_LOCATION | Path to an operator-mounted CA file (mount it into the container); overrides the packaged CA | Operator supplied | No |
The Kafka connection uses SASL_SSL security protocol with SCRAM-SHA-512 mechanism. The client verifies the broker certificate and hostname on every supported endpoint. An invalid KAFKA_PROVIDER value causes an error before any connection is attempted. Provider selection (KAFKA_PROVIDER) is available on the Python consumer path only.
Recommended upgrade flow: upgrade the image first with unchanged environment variables (behavior unchanged), then switch endpoints later by updating KAFKA_BOOTSTRAP_SERVERS, KAFKA_SASL_PASS, and KAFKA_PROVIDER.
This sinker performs no consumer-group offset migration; transferring group positions between clusters is subject to separate coordination.
| Parameter | Description | Default | Required |
|---|---|---|---|
KAFKA_BATCH_SIZE | Number of events to process in a batch | 5000 | No |
KAFKA_MAX_WAIT_IN_SEC | Maximum wait time for batch completion | 5 | No |
KAFKA_EVENT_UNMARSHALLER_THREAD_POOL_SIZE | Thread pool size for event processing | 5 | No |
You can filter events using one of the following methods (it is recommended to avoid using multiple filters simultaneously, but it is possible):
Drop List - Filter out specific event types:
KAFKA_EVENT_DROP_LIST: "CustomerSpecEvent,FileStreamEvent"
Keep List - Process only specific event types:
KAFKA_EVENT_KEEP_LIST: "GPSPositionTelemetry,ExternalInputEvent"
Plate Number Filter - Process events only from specific vehicles:
KAFKA_EVENT_KEEP_PNUM_RID_LIST: "ABC-123,DEF-456"
For a complete list of event types, refer to the default event parser configuration.
| Parameter | Description | Required |
|---|---|---|
PG_HOSTNAME | PostgreSQL server hostname | Yes |
PG_PORT | PostgreSQL server port (default: 5432) | Yes |
PG_USERNAME | PostgreSQL username | Yes |
PG_PASSWORD | PostgreSQL password | Yes |
PG_DATABASE | Database name | Yes |
The service requires two schemas in the database:
iot_telemetry - Raw telemetry events (INSERT only)
iot_aggregates - Aggregated data (full CRUD operations)
Database Connection Issues
Kafka Connection Issues
Performance Issues
KAFKA_BATCH_SIZE and KAFKA_MAX_WAIT_IN_SECFor additional support or questions about:
Content type
Image
Digest
sha256:4a7a15cfb…
Size
425.9 MB
Last updated
25 days ago
docker pull scgps/scgps-pg-sinker