84 lines
1.7 KiB
Markdown
84 lines
1.7 KiB
Markdown
# Runbook - Event Bus (Track 8, Local)
|
|
|
|
## Goal
|
|
|
|
Run the first RabbitMQ-backed event bus flow locally and verify:
|
|
|
|
- outbox writes happen in business services
|
|
- `event-bus-service` publishes events
|
|
- `audit-service` consumes them
|
|
- `reporting-service` consumes them
|
|
|
|
## Local compose path
|
|
|
|
Use Docker Compose because it includes RabbitMQ:
|
|
|
|
```powershell
|
|
cd deployment
|
|
docker compose up -d
|
|
cd ..
|
|
python scripts\migrate_core_db.py
|
|
```
|
|
|
|
RabbitMQ management UI:
|
|
|
|
- `http://localhost:15672`
|
|
- default local credentials: `guest / guest`
|
|
|
|
## Required env
|
|
|
|
The compose profile already sets:
|
|
|
|
- `EVENT_BUS_ENABLED=1`
|
|
- `EVENT_BUS_URL=amqp://guest:guest@rabbitmq:5672/`
|
|
- `EVENT_BUS_CONSUMER_ENABLED=1`
|
|
|
|
For non-compose local runs, export them manually before starting services.
|
|
|
|
## Smoke check
|
|
|
|
```powershell
|
|
python scripts\event_bus_smoke.py --base-url http://localhost:8080
|
|
```
|
|
|
|
Expected:
|
|
|
|
- gateway and `event-bus-service` are healthy
|
|
- an interaction is created
|
|
- its outbox event becomes `published`
|
|
- `audit-service` processes the event
|
|
- `reporting-service` processes the event
|
|
|
|
## Inspect outbox
|
|
|
|
```powershell
|
|
curl http://localhost:8080/proxy/event-bus/bus/outbox -H "X-User: admin" -H "X-Role: admin"
|
|
```
|
|
|
|
Useful statuses:
|
|
|
|
- `pending`
|
|
- `published`
|
|
- `failed`
|
|
|
|
## Retry a failed event
|
|
|
|
```powershell
|
|
curl -X POST http://localhost:8080/proxy/event-bus/bus/outbox/<event_id>/retry -H "X-User: admin" -H "X-Role: admin"
|
|
```
|
|
|
|
## Acceptance check
|
|
|
|
```powershell
|
|
python scripts\track8_check.py --base-url http://localhost:8080
|
|
```
|
|
|
|
## Compatibility mode
|
|
|
|
If you want to disable the bus and keep the platform on pure HTTP-only behavior:
|
|
|
|
- set `EVENT_BUS_ENABLED=0`
|
|
- restart services
|
|
|
|
The business REST APIs keep working in that mode.
|