cavalcade
cavalcade copied to clipboard
AMQP broker backed by PostgreSQL
Cavalcade
Cavalcade is an AMQP broker using a PostgreSQL-compatible database as a backing store. It can work with PostgreSQL itself, but is primarily targeted at distributed PostgreSQL-compatible databases (e.g. CockroachDB, YugabyteDB) to enable a multi-node AMQP setup.
It's primary target of compatibility is "good enough to use as a drop-in replacement for RabbitMQ with Celery" but patches to improve that are welcomed.
Status
Experimental. If you want stability, go use RabbitMQ instead and use it's clustering support for multi-node. If you want to avoid dealing with the clustering, but are happy to trade debugging Cavalcade, welcome!
It has not been optimised at all for performance, and in some cases has actively sub-optimal choices in some of the database interactions (chosen because they worked v.s. taking a lot longer to built something optimal).
In all these cases, patches to improve things are welcomed.
Usage
In all cases set DATABASE_URL to the URL for your database. Examples:
- PostgreSQL:
postgres://postgres:password@db/cavalcade - CockroachDB:
postgresql://root@crdb:26257/defaultdb?sslmode=disable
Docker config:
- Pick an image from https://hub.docker.com/r/palfrey/cavalcade or https://quay.io/repository/palfrey/cavalcade?tab=tags
- (Optionally): Download the standard logging config, customise as required and mount in the image as
/log4rs.yml - Run the migration helper, then the main app. e.g
sh -c "/cavalcade --migrate --sqlx-path=/sqlx && /cavalcade". The former should do nothing on nodes without changes, and the two steps can be split if wished.
Local config:
- Download a release build from https://github.com/palfrey/cavalcade/releases (or checkout the repo and
cargo buildit yourself) - Install SQLx CLI
- Copy the migrations for the tagged release you're using.
- Run
sqlx migrate runin a folder with the migrations from step 3. - (Optionally): Download the standard logging config and customise as required
- Run the release build without args - it assumes the logging config is in the same folder as it and that
DATABASE_URLhas been set.