Expand description
rightsize-modules ships eighteen preconfigured containers on top of the
rightsize core: Redis, Memcached, ArangoDB, MongoDB, Redpanda, Kafka,
SpringCloudConfig, PostgreSQL, MySQL, Apache Pinot, RabbitMQ, MariaDB, WireMock,
ClickHouse, Keycloak, Neo4j, Floci, and Apache Flink. Each module is a thin
newtype wrapping rightsize’s Container builder — no subclassing, just the
spec-customizer and post-start hooks the core exposes — with connection helpers on
its guard.
Backend wiring is a Cargo feature choice, not a runtime one: backend-msb and
backend-docker (both on by default) pull in rightsize-msb and
rightsize-docker respectively so consumers can trim the dependency they don’t
need. The feature-enabled backends register themselves the first time any module
starts — no register_provider boilerplate; see register_default_backends
for the one case where calling it yourself is still useful.
Re-exports§
pub use arango::ArangoContainer;pub use arango::ArangoGuard;pub use clickhouse::ClickHouseContainer;pub use clickhouse::ClickHouseGuard;pub use flink::FlinkContainer;pub use flink::FlinkGuard;pub use floci::FlociContainer;pub use floci::FlociGuard;pub use kafka::KafkaContainer;pub use kafka::KafkaGuard;pub use keycloak::KeycloakContainer;pub use keycloak::KeycloakGuard;pub use mariadb::MariaDbContainer;pub use mariadb::MariaDbGuard;pub use memcached::MemcachedContainer;pub use memcached::MemcachedGuard;pub use mongodb::MongoDbContainer;pub use mongodb::MongoDbGuard;pub use mysql::MySqlContainer;pub use mysql::MySqlGuard;pub use neo4j::Neo4jContainer;pub use neo4j::Neo4jGuard;pub use pinot::PinotContainer;pub use pinot::PinotGuard;pub use postgres::PostgresContainer;pub use postgres::PostgresGuard;pub use rabbitmq::RabbitMqContainer;pub use rabbitmq::RabbitMqGuard;pub use redis::RedisContainer;pub use redis::RedisGuard;pub use redpanda::RedpandaContainer;pub use redpanda::RedpandaGuard;pub use spring_cloud_config::SpringCloudConfigContainer;pub use spring_cloud_config::SpringCloudConfigGuard;pub use wiremock::WireMockContainer;pub use wiremock::WireMockGuard;
Modules§
- arango
- A single-node ArangoDB container. Auth is disabled by default; see
ArangoContainer::with_root_passwordto enable it. - clickhouse
- A single-node ClickHouse container, queried over its HTTP interface (port 8123).
The native protocol port (9000) is exposed too, but this module’s helpers are
HTTP-first: the HTTP interface needs no client dependency (
ureqas a dev-dep, no runtime crate), matching the house convention for HTTP-first modules. - flink
- An Apache Flink JobManager, optionally paired with a companion TaskManager
via
FlinkContainer::with_task_managerfor a real session cluster that can actually run jobs (a bare JobManager has zero task slots and can only accept/reject submissions, never execute them). - floci
- A floci.io cloud emulator — one native Quarkus image per cloud
provider, each speaking that provider’s REST APIs against an in-memory backing
store. One module type covers all three variants; pick one with the
FlociContainer::aws/FlociContainer::azure/FlociContainer::gcpfactory functions rather than a bare constructor — each factory pins the provider’s own image and guest port. - kafka
- A single-node Kafka broker (KRaft mode, no ZooKeeper).
- keycloak
- A single-node Keycloak container in
start-devmode (in-memory H2, no external database — fine for tests, never for production). - mariadb
- A single-node MariaDB container. Defaults to a
test/test/testuser/password/database trio (plusMARIADB_ROOT_PASSWORD=test) soMariaDbGuard::connection_stringis usable with zero configuration; callMariaDbContainer::with_username/MariaDbContainer::with_password/MariaDbContainer::with_databasebeforestart()to override any of them. - memcached
- A single-node Memcached container, ready-checked with a protocol-level
versionprobe instead of the bare listening-port wait. - mongodb
- A single-node MongoDB container running as a one-member replica set (required for
transactions/change streams). The
Container::with_post_starthook initiates the replica set and waits for a primary to be elected beforestart()returns, soMongoDbGuard::connection_stringis always usable immediately afterstart(). - mysql
- A single-node MySQL container. Defaults to a
test/test/testuser/password/database trio (plusMYSQL_ROOT_PASSWORD=test) soMySqlGuard::connection_stringis usable with zero configuration; callMySqlContainer::with_username/MySqlContainer::with_password/MySqlContainer::with_databasebeforestart()to override any of them. - neo4j
- A single-node Neo4j Community container, queried over its HTTP Cypher transaction
endpoint (
/db/neo4j/tx/commit) — no bolt driver dependency needed, matching the house convention for HTTP-first modules (crate::clickhouse::ClickHouseContainer,crate::pinot::PinotContainer). The bolt port (7687) is still exposed and its URI available viaNeo4jGuard::bolt_urlfor callers who do want a real driver. - pinot
- A single-container Apache Pinot “QuickStart” cluster: controller, broker, server,
minion, and an embedded ZooKeeper, all as one process tree inside one image,
started with
QuickStart -type EMPTY(a clean cluster with no demo tables — this module is a real-cluster smoke fixture, not a data-loading harness). - postgres
- A single-node PostgreSQL container. Defaults to a
test/test/testuser/password/database trio soPostgresGuard::connection_stringis usable with zero configuration; callPostgresContainer::with_username/PostgresContainer::with_password/PostgresContainer::with_databasebeforestart()to override any of them. - rabbitmq
- A single-node RabbitMQ container with the management plugin enabled. Defaults to a
guest/guestcredential pair (the image’s own default) soRabbitMqGuard::amqp_urlis usable with zero configuration; callRabbitMqContainer::with_username/RabbitMqContainer::with_passwordbeforestart()to override either. - redis
- A single-node Redis container.
- redpanda
- A single-node Redpanda broker (Kafka API-compatible) with its schema registry enabled.
- spring_
cloud_ config - A Spring Cloud Config Server container, ready-checked via its actuator health endpoint.
- wiremock
- A WireMock server container for stubbing HTTP dependencies in integration tests.
Functions§
- register_
default_ backends - Registers the feature-enabled backend providers (
backend-msb,backend-docker) withrightsize::backends. Runs its body once per process, and the core registry is itself idempotent by provider name, so calling this again — or also registering a provider by hand — is harmless.