⚠️ EARLY DEVELOPMENT - EXPERIMENTAL
A PostgreSQL extension that speaks Kafka protocol. Send messages with any Kafka client, store them in PostgreSQL tables with full SQL access.
Ever wanted to:
pg_gregor lets you use standard Kafka clients (kafka-python, Java, etc.) while storing everything in PostgreSQL tables that you can query with SQL.
docker run -p 5432:5432 -p 9092:9092 jerrinot/pg_gregor:latest
This starts:
Once the container is running, test with Python:
# pip install kafka-python psycopg2-binary
from kafka import KafkaProducer
import psycopg2
# Send message via Kafka protocol
producer = KafkaProducer(bootstrap_servers=['localhost:9092'])
producer.send('test-topic', b'Hello from Kafka client!')
producer.close()
# Query it with SQL
conn = psycopg2.connect("host=localhost port=5432 user=postgres password=postgres dbname=pg_gregor")
cur = conn.cursor()
cur.execute("SELECT * FROM kafka_messages;")
print(cur.fetchall()) # Your Kafka message is here!
What Works:
What's Missing (coming soon):
This is experimental software! Use for prototyping and testing only.
Kafka Client --[Kafka Protocol]--> pg_gregor --[SQL]--> PostgreSQL
↓ ↓ ↓
Standard API Protocol Bridge ACID Storage
Messages are stored in simple tables:
-- Your messages end up here
SELECT topic, message_key, message_value, created_at
FROM kafka_messages
WHERE topic = 'your-topic';
-- Topic metadata
SELECT * FROM kafka_topics;
This project is in very early development. Expect:
Contributions welcome! Check the GitHub repository for source code and development setup.
Remember: This is experimental software. Not for production use yet!
Content type
Image
Digest
sha256:0f2c360a0…
Size
279.7 MB
Last updated
about 1 year ago
docker pull jerrinot/pg_gregor