Etcd CDC sync service. Watches Etcd KV changes and reliably delivers them to a RabbitMQ Topic.
22
See: https://github.com/febit/etcd-cdc-rabbitmq
Etcd CDC sync service. Watches Etcd KV changes and reliably delivers them to a RabbitMQ Topic.
Fixes missed events on Watch disconnects, duplicate cross-cluster watches, and incomplete multi-key transactions. Stores offsets and elects a leader in the same source Etcd. Supports batched delivery, full config, and HA failover. One cluster runs multiple sync rules for per-business prefix isolation.
revision+key.revision multi-key delivered atomically.name-keyed routes; own prefix / routing key./metrics + stats log.Etcd Watch → rule match → group by revision → batch (batch/isolate/shard)
↓
RabbitMQ delivery (At-Least-Once)
↓
ACK → advance prefix SyncRevision
/.etcd_cdc/v1/cluster/{cluster_id}/
(lock leader_lease + per-prefix sync_revision/{encoded_prefix}).revision is monotonic within one prefix.revision txns split and emit independently; consumers de-dup.Layered load: embedded defaults (internal/config/defaults.yaml) → entry file → .d/ shards (sorted, scalars
last-win, routes merged by name).
Full fields/defaults: examples/config.yaml, internal/config/defaults.yaml.
| Section | Purpose |
|---|---|
logging | Log level |
server | metrics_addr (default :9090) |
stats | Periodic stats log (on by default) |
startup | Shared connect-retry for etcd / RabbitMQ |
cluster | id, ha_enable, lease params |
source_etcd | Etcd endpoints and auth |
cluster_meta | Offset/election store: same_etcd or independent |
batch | Ideal size, overload %, flush interval, byte cap |
rabbitmq | MQ connection, exchange, confirm, retry |
routes | Sync rules (name-keyed map) |
routes)routes:
app_config:
routing_key: "etcd.config.app" # omittable under fanout
include_prev_value: true # carry previous value in body
namespace: /biz/prod # strip on delivery; "" if none
prefixes: # watched prefixes (one or more)
- "/config/app/"
Validation:
GET /metrics at server.metrics_addr (default :9090). Tracks batches, events, errors, per-prefix
revision, offset, lag, leader status.SIGINT/SIGTERM, flush buffers, then exit. Offsets advance to highest delivered revision.stats.enabled=true prints a snapshot every stats.interval_ms (default 60s).revision. Avoids cold-prefix blocking from a
global min-watermark.Content type
Image
Digest
sha256:0a6717fb8…
Size
10.6 MB
Last updated
about 2 hours ago
docker pull febit/etcd-cdc-rabbitmq:v0.3.0