For traditional database, we have Canal, Maxwell for mysql, or pg-amqp-bridge for Postgresql, to synchronize change data from database to rabbitmq.
This tool achieves same feature via experimental core changefeed for CockroachDB.
Configuration is done through environment variables:
- DATABASE_URL: e.g.
postgresql://username:[email protected]:port/database
- AMQP_URL: e.g.
amqp://rabbitmq//
- AMQP_EXCHANGE: rabbitmq exchange name to publish messages
- TABLES: e.g.
users,orders,goods
curl https://sh.rustup.rs -sSf | sh
DATABASE_URL="postgres://root@localhost:26257/db" \
TABLES="users,orders,goods" \
AMQP_URL="amqp://localhost//" \
AMQP_EXCHANGE="cockroach_change_feed" \
RUST_LOG=info \
cargo run
docker run --rm -it --net=host \
-e DATABASE_URL="postgres://postgres@localhost:26257/db" \
-e TABLES="users,orders,goods" \
-e AMQP_URL="amqp://localhost//" \
-e AMQP_EXCHANGE="cockroach_change_feed" \
-e RUST_LOG=info \
firevale/cockroach-amqp-bridge
Anyone and everyone is welcome to contribute.
Copyright © 2013-Present 北京火谷网络科技股份有限公司
This source code is licensed under MIT license