43 lines
1.1 KiB
Markdown
43 lines
1.1 KiB
Markdown
# Buryans events — Stage 2 core
|
|
|
|
## Components
|
|
|
|
- `schema.sql` — `events.outbox`, `events.inbox`, `events.effects`.
|
|
- `event_store.py` — enqueue/consume/repeat_test.
|
|
- `nats_relay.py` — outbox → NATS JetStream, durable consumer, ack after commit.
|
|
- `../../contracts/events/envelope-v1.json` — CloudEvents v1 contract.
|
|
|
|
## Run
|
|
|
|
```bash
|
|
cd /root/buryan-infra/ops/events
|
|
PYTHONPATH=/tmp/natsvenv/lib/python3.13/site-packages python3 nats_relay.py relay
|
|
PYTHONPATH=/tmp/natsvenv/lib/python3.13/site-packages python3 nats_relay.py consume
|
|
```
|
|
|
|
NATS: `nats://192.168.1.115:4222`
|
|
Stream: `BURYANS_EVENTS`
|
|
Consumer: `buryans-worker`
|
|
|
|
## Evidence
|
|
|
|
- 100 workers same event → `first_effects=1`, `effects=1`.
|
|
- NATS e2e: 1 outbox → 1 published → 1 inbox → 1 effect.
|
|
|
|
## Durable service
|
|
|
|
```text
|
|
events-pipeline.service
|
|
```
|
|
|
|
Adapter Audit 360 → outbox → NATS → inbox/effects, tick 5s.
|
|
|
|
SQL_ASCII note: Cyrillic title is carried as `title_utf8_b64`.
|
|
|
|
## Next
|
|
|
|
- durable consumer/scheduler service;
|
|
- redelivery/replay test;
|
|
- ownership matrix/adapters;
|
|
- pgvector pilot.
|