Connector framework for xrayGraphDB — consume external sources, write over xrayProtocol
Project description
xgdb-connect -- Connector Framework for xrayGraphDB
Standalone Python processes that consume data from external sources and write to xrayGraphDB over xrayProtocol (port 7689).
Architecture
xgdb_connect/ Core framework
protocol.py xrayProtocol v1 binary client
base.py BaseConnector (connect, transform, send, checkpoint)
config.py YAML config loader
transform.py Message-to-Cypher transformer
connectors/ Source-specific implementations
nats_connector.py NATS/JetStream
redis_connector.py Redis Streams (XREADGROUP)
kafka_connector.py Apache Kafka (consumer groups)
postgres_connector.py PostgreSQL logical replication (pgoutput CDC)
mysql_connector.py MySQL binlog CDC
Installation
# Core only
pip install .
# With specific connector dependencies
pip install ".[nats]"
pip install ".[redis]"
pip install ".[kafka]"
pip install ".[postgres]"
pip install ".[mysql]"
# Everything
pip install ".[all]"
Usage
Each connector reads a YAML config file and runs as a standalone process:
python -m connectors.nats_connector --config nats.yaml
python -m connectors.redis_connector --config redis.yaml
python -m connectors.kafka_connector --config kafka.yaml
python -m connectors.postgres_connector --config postgres.yaml
python -m connectors.mysql_connector --config mysql.yaml
Config Format
source: nats
connection:
url: nats://localhost:4222
subject: "events.>"
xraygraphdb:
host: localhost
port: 7689
user: admin
password: secret
transform:
node:
label: Event
id_field: event_id
properties:
- source_field: timestamp
target: ts
- source_field: type
target: event_type
edge:
type: TRIGGERED_BY
from_field: event_id
to_field: parent_id
batch_size: 1000
checkpoint_file: /var/lib/xgdb-connect/nats.checkpoint
Features
- Batch writes -- configurable batch size, UNWIND-based Cypher for efficiency
- Checkpoint tracking -- saves last offset/position to disk for restart recovery
- Backpressure -- batches are flushed when full, with configurable size
- Graceful shutdown -- handles SIGTERM/SIGINT, flushes remaining batch, saves checkpoint
- Structured logging -- timestamped log output with configurable level
- Metrics -- messages/sec, latency, error counts logged at configurable intervals
- Reconnection -- automatic reconnect to xrayGraphDB with configurable retry (max 2 attempts)
- Transform engine -- configurable field mappings with dot-path extraction and type casting
Copyright
Copyright 2026 eMTAi LLC. All rights reserved. Patent pending.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xgdb_connect-1.0.0.tar.gz.
File metadata
- Download URL: xgdb_connect-1.0.0.tar.gz
- Upload date:
- Size: 65.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec06175100dd127fcbdcf162d5342e1cba003a63d301594a7ef7826dd4ea1505
|
|
| MD5 |
8689e989ffc234529d4e5cbdaabb2b3f
|
|
| BLAKE2b-256 |
6eb9855ff8ac65d8df7eebb4fd190f06c8c3b9c6ea50b0eaf0c875e3c5c4b5c4
|
File details
Details for the file xgdb_connect-1.0.0-py3-none-any.whl.
File metadata
- Download URL: xgdb_connect-1.0.0-py3-none-any.whl
- Upload date:
- Size: 86.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27474a46cd26538334b469519017f36b33675e05716ac80966ab6db5d27530ae
|
|
| MD5 |
8fdfa2f35edd7a53a9c093259ca2fc78
|
|
| BLAKE2b-256 |
42e88408679ec63565e99682eceaf857d61ec1f138b72772f0d997d94f6636e3
|