## About Testcontainers for Java
@@ -83,7 +82,7 @@ and then use dependencies without specifying a version:
```xml
org.testcontainers
- mysql
+ testcontainers-mysqltest
```
@@ -93,7 +92,7 @@ Using Gradle 5.0 or higher, you can add the following to the `dependencies` sect
=== "Gradle"
```groovy
implementation platform('org.testcontainers:testcontainers-bom:{{latest_version}}') //import bom
- testImplementation('org.testcontainers:mysql') //no version specified
+ testImplementation('org.testcontainers:testcontainers-mysql') //no version specified
```
@@ -186,7 +185,7 @@ A huge thank you to our sponsors:
* [Playtika](https://github.com/Playtika/testcontainers-spring-boot) - Kafka, Couchbase, MariaDB, Redis, Neo4j, Aerospike, MemSQL
* [JetBrains](https://www.jetbrains.com/) - Testing of the TeamCity plugin for HashiCorp Vault
* [Plumbr](https://plumbr.io) - Integration testing of data processing pipeline micro-services
-* [Streamlio](https://streaml.io/) - Integration and Chaos Testing of our fast data platform based on Apache Puslar, Apache Bookeeper and Apache Heron.
+* [Streamlio](https://streaml.io/) - Integration and Chaos Testing of our fast data platform based on Apache Pulsar, Apache BookKeeper and Apache Heron.
* [Spring Session](https://projects.spring.io/spring-session/) - Redis, PostgreSQL, MySQL and MariaDB integration testing
* [Apache Camel](https://camel.apache.org) - Testing Camel against native services such as Consul, Etcd and so on
* [Infinispan](https://infinispan.org) - Testing the Infinispan Server as well as integration tests with databases, LDAP and KeyCloak
@@ -220,6 +219,10 @@ A huge thank you to our sponsors:
* [Apache SeaTunnel](https://github.com/apache/incubator-seatunnel) - Integration testing with different datasource.
* [Bucket4j](https://github.com/bucket4j/bucket4j) - Java rate-limiting library based on the token-bucket algorithm.
* [Spark ClickHouse Connector](https://github.com/housepower/spark-clickhouse-connector) - Integration tests for Apache Spark with both single node ClickHouse instance and multi-node ClickHouse cluster.
+* [Quarkus](https://github.com/quarkusio/quarkus) - Testcontainers is used extensively for Quarkus' [DevServices](https://quarkus.io/guides/dev-services) feature.
+* [Apache Kyuubi](https://kyuubi.apache.org) - Integration testing with Trino as data source engine, Kafka, etc.
+* [Dash0](https://www.dash0.com) - Integration testing for OpenTelemetry Observability product.
+
## License
diff --git a/docs/js/tc-header.js b/docs/js/tc-header.js
new file mode 100644
index 00000000000..4186b6ca59b
--- /dev/null
+++ b/docs/js/tc-header.js
@@ -0,0 +1,45 @@
+const mobileToggle = document.getElementById("mobile-menu-toggle");
+const mobileSubToggle = document.getElementById("mobile-submenu-toggle");
+function toggleMobileMenu() {
+ document.body.classList.toggle('mobile-menu');
+ document.body.classList.toggle("mobile-tc-header-active");
+}
+function toggleMobileSubmenu() {
+ document.body.classList.toggle('mobile-submenu');
+}
+if (mobileToggle)
+ mobileToggle.addEventListener("click", toggleMobileMenu);
+if (mobileSubToggle)
+ mobileSubToggle.addEventListener("click", toggleMobileSubmenu);
+
+const allParentMenuItems = document.querySelectorAll("#site-header .menu-item.has-children");
+function clearActiveMenuItem() {
+ document.body.classList.remove("tc-header-active");
+ allParentMenuItems.forEach((item) => {
+ item.classList.remove("active");
+ });
+}
+function setActiveMenuItem(e) {
+ clearActiveMenuItem();
+ e.currentTarget.closest(".menu-item").classList.add("active");
+ document.body.classList.add("tc-header-active");
+}
+allParentMenuItems.forEach((item) => {
+ const trigger = item.querySelector(":scope > a, :scope > button");
+
+ trigger.addEventListener("click", (e) => {
+ if (e.currentTarget.closest(".menu-item").classList.contains("active")) {
+ clearActiveMenuItem();
+ } else {
+ setActiveMenuItem(e);
+ }
+ });
+
+ trigger.addEventListener("mouseenter", (e) => {
+ setActiveMenuItem(e);
+ });
+
+ item.addEventListener("mouseleave", (e) => {
+ clearActiveMenuItem();
+ });
+});
\ No newline at end of file
diff --git a/docs/language-logos/haskell.svg b/docs/language-logos/haskell.svg
new file mode 100644
index 00000000000..eb6de3776ec
--- /dev/null
+++ b/docs/language-logos/haskell.svg
@@ -0,0 +1,6 @@
+
diff --git a/docs/language-logos/ruby.svg b/docs/language-logos/ruby.svg
new file mode 100644
index 00000000000..05537cedf72
--- /dev/null
+++ b/docs/language-logos/ruby.svg
@@ -0,0 +1,125 @@
+
diff --git a/docs/modules/activemq.md b/docs/modules/activemq.md
new file mode 100644
index 00000000000..7959c47576a
--- /dev/null
+++ b/docs/modules/activemq.md
@@ -0,0 +1,57 @@
+# ActiveMQ
+
+Testcontainers module for [ActiveMQ](https://hub.docker.com/r/apache/activemq) and
+[Artemis](https://hub.docker.com/r/apache/artemis).
+
+## ActiveMQContainer's usage examples
+
+You can start an ActiveMQ Classic container instance from any Java application by using:
+
+
+[Default ActiveMQ container](../../modules/activemq/src/test/java/org/testcontainers/activemq/ActiveMQContainerTest.java) inside_block:container
+
+
+With custom credentials:
+
+
+[Setting custom credentials](../../modules/activemq/src/test/java/org/testcontainers/activemq/ActiveMQContainerTest.java) inside_block:settingCredentials
+
+
+## ArtemisContainer's usage examples
+
+You can start an ActiveMQ Artemis container instance from any Java application by using:
+
+
+[Default Artemis container](../../modules/activemq/src/test/java/org/testcontainers/activemq/ArtemisContainerTest.java) inside_block:container
+
+
+With custom credentials:
+
+
+[Setting custom credentials](../../modules/activemq/src/test/java/org/testcontainers/activemq/ArtemisContainerTest.java) inside_block:settingCredentials
+
+
+With anonymous login:
+
+
+[Allow anonymous login](../../modules/activemq/src/test/java/org/testcontainers/activemq/ArtemisContainerTest.java) inside_block:enableAnonymousLogin
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-activemq:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-activemq
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/azure.md b/docs/modules/azure.md
index 5e80270e90c..461fcc9f679 100644
--- a/docs/modules/azure.md
+++ b/docs/modules/azure.md
@@ -5,20 +5,147 @@ This module is INCUBATING. While it is ready for use and operational in the curr
Testcontainers module for the Microsoft Azure's [SDK](https://github.com/Azure/azure-sdk-for-java).
-Currently, the module supports `CosmosDB` emulator. In order to use it, you should use the following class:
+Currently, the module supports `Azurite`, `Azure Event Hubs`, `Azure Service Bus` and `CosmosDB` emulators. In order to use them, you should use the following classes:
Class | Container Image
-|-
+AzuriteContainer | [mcr.microsoft.com/azure-storage/azurite](https://github.com/microsoft/containerregistry)
+EventHubsEmulatorContainer | [mcr.microsoft.com/azure-messaging/eventhubs-emulator](https://github.com/microsoft/containerregistry)
+ServiceBusEmulatorContainer | [mcr.microsoft.com/azure-messaging/servicebus-emulator](https://github.com/microsoft/containerregistry)
CosmosDBEmulatorContainer | [mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator](https://github.com/microsoft/containerregistry)
## Usage example
+### Azurite Storage Emulator
+
+Start Azurite Emulator during a test:
+
+
+[Starting an Azurite container](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:emulatorContainer
+
+
+!!! note
+ SSL configuration is possible using the `withSsl(MountableFile, String)` and `withSsl(MountableFile, MountableFile)` methods.
+
+Newer Azure Storage SDK versions can send API versions that Azurite does not support. Use `withCommandOptions(...)` to append extra Azurite flags such as `--skipApiVersionCheck`. `AzuriteContainer` rebuilds its process command in `configure()`, so `.withCommand(...)` cannot be used for extra flags.
+
+
+[Pass extra Azurite command options](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerCommandTest.java) inside_block:commandOptions
+
+
+If the tested application needs to use more than one set of credentials, the container can be configured to use custom credentials.
+Please see some examples below.
+
+
+[Starting an Azurite Blob container with one account and two keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withTwoAccountKeys
+
+
+
+[Starting an Azurite Blob container with more accounts and keys](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:withMoreAccounts
+
+
+#### Using with Blob
+
+Build Azure Blob client:
+
+
+[Build Azure Blob Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createBlobClient
+
+
+In case the application needs to use custom credentials, we can obtain them with a different method:
+
+
+[Obtain connection string with non-default credentials](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:useNonDefaultCredentials
+
+
+#### Using with Queue
+
+Build Azure Queue client:
+
+
+[Build Azure Queue Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createQueueClient
+
+
+!!! note
+ We can use custom credentials the same way as defined in the Blob section.
+
+#### Using with Table
+
+Build Azure Table client:
+
+
+[Build Azure Table Service client](../../modules/azure/src/test/java/org/testcontainers/azure/AzuriteContainerTest.java) inside_block:createTableClient
+
+
+!!! note
+ We can use custom credentials the same way as defined in the Blob section.
+
+### Azure Event Hubs Emulator
+
+
+[Configuring the Azure Event Hubs Emulator container](../../modules/azure/src/test/resources/eventhubs_config.json)
+
+
+Start Azure Event Hubs Emulator during a test:
+
+
+[Setting up a network](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:network
+
+
+
+[Starting an Azurite container as dependency](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:azuriteContainer
+
+
+
+[Starting an Azure Event Hubs Emulator container](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:emulatorContainer
+
+
+#### Using Azure Event Hubs clients
+
+Configure the consumer and the producer clients:
+
+
+[Configuring the clients](../../modules/azure/src/test/java/org/testcontainers/azure/EventHubsEmulatorContainerTest.java) inside_block:createProducerAndConsumer
+
+
+### Azure Service Bus Emulator
+
+
+[Configuring the Azure Service Bus Emulator container](../../modules/azure/src/test/resources/service-bus-config.json)
+
+
+Start Azure Service Bus Emulator during a test:
+
+
+[Setting up a network](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:network
+
+
+
+[Starting a SQL Server container as dependency](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:sqlContainer
+
+
+
+[Starting a Service Bus Emulator container](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:emulatorContainer
+
+
+#### Using Azure Service Bus clients
+
+Configure the sender and the processor clients:
+
+
+[Configuring the sender client](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:senderClient
+
+
+
+[Configuring the processor client](../../modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java) inside_block:processorClient
+
+
### CosmosDB
Start Azure CosmosDB Emulator during a test:
-[Starting a Azure CosmosDB Emulator container](../../modules/azure/src/test/java/org/testcontainers/containers/CosmosDBEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting an Azure CosmosDB Emulator container](../../modules/azure/src/test/java/org/testcontainers/containers/CosmosDBEmulatorContainerTest.java) inside_block:emulatorContainer
Prepare KeyStore to use for SSL.
@@ -51,14 +178,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:azure:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-azure:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- azure
+ testcontainers-azure{{latest_version}}test
diff --git a/docs/modules/chromadb.md b/docs/modules/chromadb.md
new file mode 100644
index 00000000000..bb50dfe3c02
--- /dev/null
+++ b/docs/modules/chromadb.md
@@ -0,0 +1,30 @@
+# ChromaDB
+
+Testcontainers module for [ChromaDB](https://registry.hub.docker.com/r/chromadb/chroma)
+
+## ChromaDB's usage examples
+
+You can start a ChromaDB container instance from any Java application by using:
+
+
+[Default ChromaDB container](../../modules/chromadb/src/test/java/org/testcontainers/chromadb/ChromaDBContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-chromadb:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+org.testcontainers
+testcontainers-chromadb
+{{latest_version}}
+test
+
+```
diff --git a/docs/modules/consul.md b/docs/modules/consul.md
index d0eafd6b1a8..bcdf7146da3 100644
--- a/docs/modules/consul.md
+++ b/docs/modules/consul.md
@@ -19,18 +19,17 @@ test how your application behaves with Consul by writing different test scenario
Add the following dependency to your `pom.xml`/`build.gradle` file:
-```groovy tab='Gradle'
-testImplementation "org.testcontainers:consul:{{latest_version}}"
-```
-
-```xml tab='Maven'
-
- org.testcontainers
- consul
- {{latest_version}}
- test
-
-```
-
-See [AUTHORS](https://raw.githubusercontent.com/testcontainers/testcontainers-java/main/modules/consul/AUTHORS) for contributors.
-
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-consul:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-consul
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/databases/cassandra.md b/docs/modules/databases/cassandra.md
index 73f93bf203a..9cc5e12499b 100644
--- a/docs/modules/databases/cassandra.md
+++ b/docs/modules/databases/cassandra.md
@@ -2,14 +2,36 @@
## Usage example
-This example connects to the Cassandra Cluster, creates a keyspaces and asserts that is has been created.
+This example connects to the Cassandra cluster:
+
+1. Define a container:
+
+ [Container definition](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:container-definition
+
+
+2. Build a `CqlSession`:
+
+ [Building CqlSession](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:cql-session
+
+
+3. Define a container with custom `cassandra.yaml` located in a directory `cassandra-auth-required-configuration`:
+
+
+ [Running init script with required authentication](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:init-with-auth
+
+
+## Using secure connection (TLS)
+
+If you override the default `cassandra.yaml` with a version setting the property `client_encryption_options.optional`
+to `false`, you have to provide a valid client certificate and key (PEM format) when you initialize your container:
-[Building CqlSession](../../../modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java) inside_block:cassandra
+[SSL setup](../../../modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java) inside_block:with-ssl-config
-!!! warning
- All methods returning instances of the Cassandra Driver's Cluster object in `CassandraContainer` have been deprecated. Providing these methods unnecessarily couples the Container to the Driver and creates potential breaking changes if the driver is updated.
+!!! hint
+ To generate the client certificate and key, please refer to
+ [this documentation](https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureSSLCertificates.html).
## Adding this module to your project dependencies
@@ -17,14 +39,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:cassandra:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-cassandra:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- cassandra
+ testcontainers-cassandra{{latest_version}}test
diff --git a/docs/modules/databases/clickhouse.md b/docs/modules/databases/clickhouse.md
index b3494867edf..4e49c69c276 100644
--- a/docs/modules/databases/clickhouse.md
+++ b/docs/modules/databases/clickhouse.md
@@ -1,19 +1,35 @@
# Clickhouse Module
+Testcontainers module for [ClickHouse](https://hub.docker.com/r/clickhouse/clickhouse-server)
+
+## Usage example
+
+You can start a ClickHouse container instance from any Java application by using:
+
+
+[Container definition](../../../modules/clickhouse/src/test/java/org/testcontainers/clickhouse/ClickHouseContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:clickhouse:18.10.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:clickhouse:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-clickhouse:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- clickhouse
+ testcontainers-clickhouse{{latest_version}}test
diff --git a/docs/modules/databases/cockroachdb.md b/docs/modules/databases/cockroachdb.md
index 45e3f75b86c..add1b9cd1aa 100644
--- a/docs/modules/databases/cockroachdb.md
+++ b/docs/modules/databases/cockroachdb.md
@@ -1,21 +1,37 @@
# CockroachDB Module
+Testcontainers module for [CockroachDB](https://hub.docker.com/r/cockroachdb/cockroach)
+
+## Usage example
+
+You can start a CockroachDB container instance from any Java application by using:
+
+
+[Container definition](../../../modules/cockroachdb/src/test/java/org/testcontainers/cockroachdb/CockroachContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:cockroach:v21.2.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:cockroachdb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-cockroachdb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- cockroachdb
+ testcontainers-cockroachdb{{latest_version}}test
diff --git a/docs/modules/databases/couchbase.md b/docs/modules/databases/couchbase.md
index 5c1ff9f5580..997347611e2 100644
--- a/docs/modules/databases/couchbase.md
+++ b/docs/modules/databases/couchbase.md
@@ -29,13 +29,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:couchbase:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-couchbase:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- couchbase
+ testcontainers-couchbase{{latest_version}}test
diff --git a/docs/modules/databases/cratedb.md b/docs/modules/databases/cratedb.md
new file mode 100644
index 00000000000..25fd1642a9d
--- /dev/null
+++ b/docs/modules/databases/cratedb.md
@@ -0,0 +1,41 @@
+# CrateDB Module
+
+Testcontainers module for [CrateDB](https://hub.docker.com/_/crate)
+
+## Usage example
+
+You can start a CrateDB container instance from any Java application by using:
+
+
+[Container definition](../../../modules/cratedb/src/test/java/org/testcontainers/junit/cratedb/SimpleCrateDBTest.java) inside_block:container
+
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:cratedb:5.2.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-cratedb:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-cratedb
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
diff --git a/docs/modules/databases/databend.md b/docs/modules/databases/databend.md
new file mode 100644
index 00000000000..510dffb2f3e
--- /dev/null
+++ b/docs/modules/databases/databend.md
@@ -0,0 +1,40 @@
+# Databend Module
+
+Testcontainers module for [Databend](https://hub.docker.com/r/datafuselabs/databend)
+
+## Usage example
+
+You can start a Databend container instance from any Java application by using:
+
+
+[Container definition](../../../modules/databend/src/test/java/org/testcontainers/databend/DatabendContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:databend:v1.2.615:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-databend:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-databend
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
diff --git a/docs/modules/databases/db2.md b/docs/modules/databases/db2.md
index 945536cac05..ce05f6ae308 100644
--- a/docs/modules/databases/db2.md
+++ b/docs/modules/databases/db2.md
@@ -1,33 +1,25 @@
# DB2 Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [DB2](https://www.ibm.com/docs/en/db2/11.5.x?topic=deployments-db2-community-edition-docker)
## Usage example
-Running DB2 as a stand-in for in a test:
-
-```java
-public class SomeTest {
+You can start a DB2 container instance from any Java application by using:
- @ClassRule
- public Db2Container db2 = new Db2Container()
- .acceptLicense();
-
- @Test
- public void someTestMethod() {
- String url = db2.getJdbcUrl();
-
- ... create a connection and run test as normal
- }
-```
+
+[Container definition](../../../modules/db2/src/test/java/org/testcontainers/db2/Db2ContainerTest.java) inside_block:container
+
!!! warning "EULA Acceptance"
Due to licencing restrictions you are required to accept an EULA for this container image. To indicate that you accept the DB2 image EULA, call the `acceptLicense()` method, or place a file at the root of the classpath named `container-license-acceptance.txt`, e.g. at `src/test/resources/container-license-acceptance.txt`. This file should contain the line: `ibmcom/db2:11.5.0.0a` (or, if you are overriding the docker image name/tag, update accordingly).
-
- Please see the [`ibmcom/db2` image documentation](https://hub.docker.com/r/ibmcom/db2) for a link to the EULA document.
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:db2:11.5.0.0a:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
## Adding this module to your project dependencies
@@ -35,13 +27,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:db2:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-db2:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- db2
+ testcontainers-db2{{latest_version}}test
diff --git a/docs/modules/databases/dynalite.md b/docs/modules/databases/dynalite.md
deleted file mode 100644
index 8807ad7f025..00000000000
--- a/docs/modules/databases/dynalite.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Dynalite Module
-
-Testcontainers module for [Dynalite](https://github.com/mhart/dynalite). Dynalite is a clone of DynamoDB, enabling local testing.
-
-## Usage example
-
-Running Dynalite as a stand-in for DynamoDB in a test:
-
-```java
-public class SomeTest {
-
- @Rule
- public DynaliteContainer dynamoDB = new DynaliteContainer();
-
- @Test
- public void someTestMethod() {
- // getClient() returns a preconfigured DynamoDB client that is connected to the
- // dynalite container
- final AmazonDynamoDB client = dynamoDB.getClient();
-
- ... interact with client as if using DynamoDB normally
-```
-
-## Why Dynalite for DynamoDB testing?
-
-In part, because it's light and quick to run. Also, please see the [reasons given](https://github.com/mhart/dynalite#why-not-amazons-dynamodb-local) by the author of Dynalite and the [problems with Amazon's DynamoDB Local](https://github.com/mhart/dynalite#problems-with-amazons-dynamodb-local-updated-2016-04-19).
-
-## Adding this module to your project dependencies
-
-Add the following dependency to your `pom.xml`/`build.gradle` file:
-
-=== "Gradle"
- ```groovy
- testImplementation "org.testcontainers:dynalite:{{latest_version}}"
- ```
-=== "Maven"
- ```xml
-
- org.testcontainers
- dynalite
- {{latest_version}}
- test
-
- ```
-
-!!! hint
- Adding this Testcontainers library JAR will not automatically add an AWS SDK JAR to your project. You should ensure that your project also has a suitable AWS SDK JAR as a dependency.
diff --git a/docs/modules/databases/influxdb.md b/docs/modules/databases/influxdb.md
index 8055f6aed57..9644a5eb92b 100644
--- a/docs/modules/databases/influxdb.md
+++ b/docs/modules/databases/influxdb.md
@@ -90,7 +90,7 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:influxdb:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-influxdb:{{latest_version}}"
```
=== "Maven"
@@ -99,7 +99,7 @@ testImplementation "org.testcontainers:influxdb:{{latest_version}}"
org.testcontainers
- influxdb
+ testcontainers-influxdb{{latest_version}}test
diff --git a/docs/modules/databases/jdbc.md b/docs/modules/databases/jdbc.md
index 6cf4977ad96..72539aef44e 100644
--- a/docs/modules/databases/jdbc.md
+++ b/docs/modules/databases/jdbc.md
@@ -20,41 +20,81 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
!!! note
We will use `///` (host-less URIs) from now on to emphasis the unimportance of the `host:port` pair.
- From Testcontainers' perspective, `jdbc:mysql:5.7.34://localhost:3306/databasename` and `jdbc:mysql:5.7.34:///databasename` is the same URI.
+ From Testcontainers' perspective, `jdbc:mysql:8.0.36://localhost:3306/databasename` and `jdbc:mysql:8.0.36:///databasename` is the same URI.
!!! warning
If you're using the JDBC URL support, there is no need to instantiate an instance of the container - Testcontainers will do it automagically.
### JDBC URL examples
-#### Using Testcontainers with a fixed version
+#### Using ClickHouse
-`jdbc:tc:mysql:5.7.34:///databasename`
+`jdbc:tc:clickhouse:18.10.3:///databasename`
-#### Using PostgreSQL
+#### Using CockroachDB
-`jdbc:tc:postgresql:9.6.8:///databasename`
+`jdbc:tc:cockroach:v21.2.3:///databasename`
+
+#### Using CrateDB
+
+`jdbc:tc:cratedb:5.2.3:///databasename`
+
+#### Using DB2
+
+`jdbc:tc:db2:11.5.0.0a:///databasename`
+
+#### Using MariaDB
+
+`jdbc:tc:mariadb:10.3.39:///databasename`
+
+#### Using MySQL
+
+`jdbc:tc:mysql:8.0.36:///databasename`
+
+#### Using MSSQL Server
+
+`jdbc:tc:sqlserver:2017-CU12:///databasename`
+
+#### Using OceanBase
+
+`jdbc:tc:oceanbasece:4.2.1-lts:///databasename`
+
+#### Using Oracle
+
+`jdbc:tc:oracle:21-slim-faststart:///databasename`
#### Using PostGIS
`jdbc:tc:postgis:9.6-2.5:///databasename`
-#### Using TimescaleDB
+#### Using PostgreSQL
-`jdbc:tc:timescaledb:2.1.0-pg13:///databasename`
+`jdbc:tc:postgresql:9.6.8:///databasename`
-#### Using Trino
+#### Using QuestDB
-`jdbc:tc:trino:352://localhost/memory/default`
+`jdbc:tc:questdb:6.5.3:///databasename`
-#### Using CockroachDB
+#### Using TimescaleDB
-`jdbc:tc:cockroach:v21.2.3:///databasename`
+`jdbc:tc:timescaledb:2.1.0-pg13:///databasename`
+
+#### Using PGVector
+
+`jdbc:tc:pgvector:pg16:///databasename`
#### Using TiDB
`jdbc:tc:tidb:v6.1.0:///databasename`
+#### Using Timeplus
+
+`jdbc:tc:timeplus:2.3.21:///databasename`
+
+#### Using Trino
+
+`jdbc:tc:trino:352://localhost/memory/default`
+
#### Using YugabyteDB
`jdbc:tc:yugabyte:2.14.4.0-b26:///databasename`
@@ -64,7 +104,7 @@ Insert `tc:` after `jdbc:` as follows. Note that the hostname, port and database
Testcontainers can run an init script after the database container is started, but before your code is given a connection to it. The script must be on the classpath, and is referenced as follows:
-`jdbc:tc:mysql:5.7.34:///databasename?TC_INITSCRIPT=somepath/init_mysql.sql`
+`jdbc:tc:mysql:8.0.36:///databasename?TC_INITSCRIPT=somepath/init_mysql.sql`
This is useful if you have a fixed script for setting up database schema, etc.
@@ -72,13 +112,13 @@ This is useful if you have a fixed script for setting up database schema, etc.
If the init script path is prefixed `file:`, it will be loaded from a file (relative to the working directory, which will usually be the project root).
-`jdbc:tc:mysql:5.7.34:///databasename?TC_INITSCRIPT=file:src/main/resources/init_mysql.sql`
+`jdbc:tc:mysql:8.0.36:///databasename?TC_INITSCRIPT=file:src/main/resources/init_mysql.sql`
### Using an init function
Instead of running a fixed script for DB setup, it may be useful to call a Java function that you define. This is intended to allow you to trigger database schema migration tools. To do this, add TC_INITFUNCTION to the URL as follows, passing a full path to the class name and method:
- `jdbc:tc:mysql:5.7.34:///databasename?TC_INITFUNCTION=org.testcontainers.jdbc.JDBCDriverTest::sampleInitFunction`
+ `jdbc:tc:mysql:8.0.36:///databasename?TC_INITFUNCTION=org.testcontainers.jdbc.JDBCDriverTest::sampleInitFunction`
The init function must be a public static method which takes a `java.sql.Connection` as its only parameter, e.g.
```java
@@ -93,9 +133,9 @@ public class JDBCDriverTest {
By default database container is being stopped as soon as last connection is closed. There are cases when you might need to start container and keep it running till you stop it explicitly or JVM is shutdown. To do this, add `TC_DAEMON` parameter to the URL as follows:
- `jdbc:tc:mysql:5.7.34:///databasename?TC_DAEMON=true`
+ `jdbc:tc:mysql:8.0.36:///databasename?TC_DAEMON=true`
-With this parameter database container will keep running even when there're no open connections.
+With this parameter database container will keep running even when there's no open connections.
### Running container with tmpfs options
diff --git a/docs/modules/databases/mariadb.md b/docs/modules/databases/mariadb.md
index 25367d629bd..d90f9381cb5 100644
--- a/docs/modules/databases/mariadb.md
+++ b/docs/modules/databases/mariadb.md
@@ -1,7 +1,23 @@
# MariaDB Module
+Testcontainers module for [MariaDB](https://hub.docker.com/_/mariadb)
+
+## Usage example
+
+You can start a MySQL container instance from any Java application by using:
+
+
+[Container definition](../../../modules/mariadb/src/test/java/org/testcontainers/mariadb/MariaDBContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:mariadb:10.3.39:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## MariaDB `root` user password
If no custom password is specified, the container will use the default user password `test` for the `root` user as well.
@@ -14,13 +30,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mariadb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mariadb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mariadb
+ testcontainers-mariadb{{latest_version}}test
diff --git a/docs/modules/databases/mongodb.md b/docs/modules/databases/mongodb.md
index 9e81e28c39f..b861d83bb2c 100644
--- a/docs/modules/databases/mongodb.md
+++ b/docs/modules/databases/mongodb.md
@@ -1,20 +1,24 @@
# MongoDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+The MongoDB module provides two Testcontainers for MongoDB unit testing:
+
+* [MongoDBContainer](#mongodbcontainer) - the core MongoDB database
+* [MongoDBAtlasLocalContainer](#mongodbatlaslocalcontainer) - the core MongoDB database combined with MongoDB Atlas Search + Atlas Vector Search
+
+## MongoDBContainer
-## Usage example
+### Usage example
The following example shows how to create a MongoDBContainer:
-[Creating a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/containers/MongoDBContainerTest.java) inside_block:creatingMongoDBContainer
+[Creating a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBContainerTest.java) inside_block:creatingMongoDBContainer
And how to start it:
-[Starting a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/containers/MongoDBContainerTest.java) inside_block:startingMongoDBContainer
+[Starting a MongoDB container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBContainerTest.java) inside_block:startingMongoDBContainer
!!! note
@@ -36,26 +40,57 @@ For instance, to initialize a single node replica set on fixed ports via Docker,
As we can see, there is a lot of operations to execute and we even haven't touched a non-fixed port approach.
That's where the MongoDBContainer might come in handy.
+## MongoDBAtlasLocalContainer
+
+### Usage example
+
+The following example shows how to create a MongoDBAtlasLocalContainer:
+
+
+[Creating a MongoDB Atlas Local Container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:creatingAtlasLocalContainer
+
+
+And how to start it:
+
+
+[Start the Container](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:startingAtlasLocalContainer
+
+
+The connection string provided by the MongoDBAtlasLocalContainer's getConnectionString() method includes the dynamically allocated port:
+
+
+[Get the Connection String](../../../modules/mongodb/src/test/java/org/testcontainers/mongodb/MongoDBAtlasLocalContainerTest.java) inside_block:getConnectionStringAtlasLocalContainer
+
+
+e.g. `mongodb://localhost:12345/?directConnection=true`
+
+### References
+MongoDB Atlas Local combines the MongoDB database engine with MongoT, a sidecar process for advanced searching capabilities built by MongoDB and powered by [Apache Lucene](https://lucene.apache.org/).
+
+The container (mongodb/mongodb-atlas-local) documentation can be found [here](https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-docker/).
+
+General information about Atlas Search can be found [here](https://www.mongodb.com/docs/atlas/atlas-search/).
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mongodb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mongodb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mongodb
+ testcontainers-mongodb{{latest_version}}test
```
!!! hint
-Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency
#### Copyright
Copyright (c) 2019 Konstantin Silaev
diff --git a/docs/modules/databases/mssqlserver.md b/docs/modules/databases/mssqlserver.md
index 9d0912f2563..5c9d7b0a9fb 100644
--- a/docs/modules/databases/mssqlserver.md
+++ b/docs/modules/databases/mssqlserver.md
@@ -1,43 +1,41 @@
# MS SQL Server Module
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [MS SQL Server](https://mcr.microsoft.com/en-us/artifact/mar/mssql/server/)
## Usage example
-Running MS SQL Server as a stand-in for in a test:
-
-```java
-public class SomeTest {
+You can start a MS SQL Server container instance from any Java application by using:
- @Rule
- public MSSQLServerContainer mssqlserver = new MSSQLServerContainer()
- .acceptLicense();
-
- @Test
- public void someTestMethod() {
- String url = mssqlserver.getJdbcUrl();
-
- ... create a connection and run test as normal
-```
+
+[Container definition](../../../modules/mssqlserver/src/test/java/org/testcontainers/mssqlserver/MSSQLServerContainerTest.java) inside_block:container
+
!!! warning "EULA Acceptance"
Due to licencing restrictions you are required to accept an EULA for this container image. To indicate that you accept the MS SQL Server image EULA, call the `acceptLicense()` method, or place a file at the root of the classpath named `container-license-acceptance.txt`, e.g. at `src/test/resources/container-license-acceptance.txt`. This file should contain the line: `mcr.microsoft.com/mssql/server:2017-CU12` (or, if you are overriding the docker image name/tag, update accordingly).
Please see the [`microsoft-mssql-server` image documentation](https://hub.docker.com/_/microsoft-mssql-server#environment-variables) for a link to the EULA document.
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:sqlserver:2017-CU12:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mssqlserver:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mssqlserver:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mssqlserver
+ testcontainers-mssqlserver{{latest_version}}test
diff --git a/docs/modules/databases/mysql.md b/docs/modules/databases/mysql.md
index 6e6265e91ba..1747989766f 100644
--- a/docs/modules/databases/mysql.md
+++ b/docs/modules/databases/mysql.md
@@ -1,13 +1,29 @@
# MySQL Module
+Testcontainers module for [MySQL](https://hub.docker.com/_/mysql)
+
+## Usage example
+
+You can start a MySQL container instance from any Java application by using:
+
+
+[Container definition](../../../modules/mysql/src/test/java/org/testcontainers/mysql/MySQLContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:mysql:8.0.36:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Overriding MySQL my.cnf settings
For MySQL databases, it is possible to override configuration settings using resources on the classpath. Assuming `somepath/mysql_conf_override`
is a directory on the classpath containing .cnf files, the following URL can be used:
- `jdbc:tc:mysql:5.7.34://hostname/databasename?TC_MY_CNF=somepath/mysql_conf_override`
+ `jdbc:tc:mysql:8.0.36://hostname/databasename?TC_MY_CNF=somepath/mysql_conf_override`
Any .cnf files in this classpath directory will be mapped into the database container's /etc/mysql/conf.d directory,
and will be able to override server settings when the container starts.
@@ -24,13 +40,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mysql:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mysql:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mysql
+ testcontainers-mysql{{latest_version}}test
diff --git a/docs/modules/databases/neo4j.md b/docs/modules/databases/neo4j.md
index dddf5c4e8f8..c7b06e99fe7 100644
--- a/docs/modules/databases/neo4j.md
+++ b/docs/modules/databases/neo4j.md
@@ -1,24 +1,20 @@
# Neo4j Module
-This module helps running [Neo4j](https://neo4j.com/download/) using Testcontainers.
+This module helps to run [Neo4j](https://neo4j.com/download/) using Testcontainers.
Note that it's based on the [official Docker image](https://hub.docker.com/_/neo4j/) provided by Neo4j, Inc.
-## Usage example
+Even though the latest LTS version of Neo4j 4.4 is used in the examples of this documentation,
+the Testcontainers integration supports also newer 5.x images of Neo4j.
-Declare your Testcontainers as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers.
-You can either use call `getBoltUrl()` or `getHttpUrl()` on the Neo4j container.
-`getBoltUrl()` is meant to be used with one of the [official Bolt drivers](https://neo4j.com/developer/language-guides/) while `getHttpUrl()` gives you the HTTP-address of the transactional HTTP endpoint.
-On the JVM you would most likely use the [Java driver](https://github.com/neo4j/neo4j-java-driver).
+## Usage example
-The following example uses the JUnit 5 extension `@Testcontainers` and demonstrates both the usage of the Java Driver and the REST endpoint:
+You can start a Neo4j container instance from any Java application by using:
-[JUnit 5 example](../../../examples/neo4j-container/src/test/java/org/testcontainers/containers/Neo4jExampleTest.java) inside_block:junitExample
+[Neo4j container](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:container
-You are not limited to Unit tests and can of course use an instance of the Neo4j Testcontainers in vanilla Java code as well.
-
## Additional features
### Custom password
@@ -26,7 +22,7 @@ You are not limited to Unit tests and can of course use an instance of the Neo4j
A custom password can be provided:
-[Custom password](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withAdminPassword
+[Custom password](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withAdminPassword
### Disable authentication
@@ -34,7 +30,7 @@ A custom password can be provided:
Authentication can be disabled:
-[Disable authentication](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withoutAuthentication
+[Disable authentication](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withoutAuthentication
### Random password
@@ -42,7 +38,7 @@ Authentication can be disabled:
A random (`UUID`-random based) password can be set:
-[Random password](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:withRandomPassword
+[Random password](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:withRandomPassword
### Neo4j-Configuration
@@ -51,7 +47,7 @@ Neo4j's Docker image needs Neo4j configuration options in a dedicated format.
The container takes care of that, and you can configure the database with standard options like the following:
-[Neo4j configuration](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:neo4jConfiguration
+[Neo4j configuration](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:neo4jConfiguration
### Add custom plugins
@@ -59,27 +55,26 @@ The container takes care of that, and you can configure the database with standa
Custom plugins, like APOC, can be copied over to the container from any classpath or host resource like this:
-[Plugin jar](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:registerPluginsJar
+[Plugin jar](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:registerPluginsJar
Whole directories work as well:
-[Plugin folder](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:registerPluginsPath
+[Plugin folder](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:registerPluginsPath
### Add Neo4j Docker Labs plugins
-Add any Neo4j Labs plugin from the [Neo4j Docker Labs plugin list](https://neo4j.com/docs/operations-manual/4.4/docker/operations/#docker-neo4jlabs-plugins).
+Add any Neo4j Labs plugin from the [Neo4j 4.4 Docker Labs plugin list](https://neo4j.com/docs/operations-manual/4.4/docker/operations/#docker-neo4jlabs-plugins)
+or [Neo4j 5 plugin list](https://neo4j.com/docs/operations-manual/5/configuration/plugins/).
!!! note
- At the moment only the plugins available from the list Neo4j Docker 4.4 are supported by type.
- If you want to register another supported Neo4j Labs plugin, you have to add it manually
- by using the method `withLabsPlugins(String... neo4jLabsPlugins)`.
- Please refer to the list of [supported Docker image plugins](https://neo4j.com/docs/operations-manual/current/docker/operations/#docker-neo4jlabs-plugins).
+ The methods `withLabsPlugins(Neo4jLabsPlugin...)` and `withLabsPlugins(String... plugins)` are deprecated.
+ Please the method `withPlugins(String... plugins)`.
-[Configure Neo4j Labs Plugins](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:configureLabsPlugins
+[Configure Neo4j Labs Plugins](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:configureLabsPlugins
@@ -88,7 +83,7 @@ Add any Neo4j Labs plugin from the [Neo4j Docker Labs plugin list](https://neo4j
If you have an existing database (`graph.db`) you want to work with, copy it over to the container like this:
-[Copy database](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:copyDatabase
+[Copy database](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:copyDatabase
!!! note
@@ -99,12 +94,16 @@ If you have an existing database (`graph.db`) you want to work with, copy it ove
If you need the Neo4j enterprise license, you can declare your Neo4j container like this:
-[Enterprise edition](../../../modules/neo4j/src/test/java/org/testcontainers/containers/Neo4jContainerTest.java) inside_block:enterpriseEdition
+[Enterprise edition](../../../modules/neo4j/src/test/java/org/testcontainers/neo4j/Neo4jContainerTest.java) inside_block:enterpriseEdition
-This creates a Testcontainers based on the Docker image build with the Enterprise version of Neo4j.
+This creates a Testcontainers based on the Docker image build with the Enterprise version of Neo4j 4.4.
The call to `withEnterpriseEdition` adds the required environment variable that you accepted the terms and condition of the enterprise version.
-You accept those by adding a file named `container-license-acceptance.txt` to the root of your classpath containing the text `neo4j:3.5.0-enterprise` in one line.
+You accept those by adding a file named `container-license-acceptance.txt` to the root of your classpath containing the text `neo4j:4.4-enterprise` in one line.
+
+If you are planning to run a newer Neo4j 5.x enterprise edition image, you have to manually define the proper enterprise image (e.g. `neo4j:5-enterprise`)
+and set the environment variable `NEO4J_ACCEPT_LICENSE_AGREEMENT` by adding `.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")` to your container definition.
+
You'll find more information about licensing Neo4j here: [About Neo4j Licenses](https://neo4j.com/licensing/).
@@ -114,13 +113,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:neo4j:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-neo4j:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- neo4j
+ testcontainers-neo4j{{latest_version}}test
@@ -131,7 +130,7 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- compile "org.neo4j.driver:neo4j-java-driver:4.4.3"
+ compile "org.neo4j.driver:neo4j-java-driver:4.4.13"
```
=== "Maven"
@@ -139,6 +138,6 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
org.neo4j.driverneo4j-java-driver
- 4.4.3
+ 4.4.13
```
diff --git a/docs/modules/databases/oceanbase.md b/docs/modules/databases/oceanbase.md
new file mode 100644
index 00000000000..c315a871058
--- /dev/null
+++ b/docs/modules/databases/oceanbase.md
@@ -0,0 +1,41 @@
+# OceanBase Module
+
+Testcontainers module for [OceanBase](https://hub.docker.com/r/oceanbase/oceanbase-ce)
+
+## Usage example
+
+You can start an OceanBase container instance from any Java application by using:
+
+
+[Container definition](../../../modules/oceanbase/src/test/java/org/testcontainers/oceanbase/SimpleOceanBaseCETest.java) inside_block:container
+
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oceanbasece:4.2.1-lts:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-oceanbase:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-oceanbase
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
diff --git a/docs/modules/databases/oraclefree.md b/docs/modules/databases/oraclefree.md
new file mode 100644
index 00000000000..75f3d677ffc
--- /dev/null
+++ b/docs/modules/databases/oraclefree.md
@@ -0,0 +1,42 @@
+# Oracle Database Free Module
+
+Testcontainers module for [Oracle Free](https://hub.docker.com/r/gvenzl/oracle-free)
+
+## Usage example
+
+You can start an Oracle-Free container instance from any Java application by using:
+
+
+[Container creation](../../../modules/oracle-free/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:container
+
+
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oracle:21-slim-faststart:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-oracle-free:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-oracle-free
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
+
diff --git a/docs/modules/databases/oraclexe.md b/docs/modules/databases/oraclexe.md
index bfc06d9a106..8d060ed65be 100644
--- a/docs/modules/databases/oraclexe.md
+++ b/docs/modules/databases/oraclexe.md
@@ -1,27 +1,36 @@
# Oracle-XE Module
-See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+Testcontainers module for [Oracle XE](https://hub.docker.com/r/gvenzl/oracle-xe)
## Usage example
-You can use `OracleContainer` like any other JDBC container:
+You can start an Oracle-XE container instance from any Java application by using:
+
-[Container creation](../../../modules/oracle-xe/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:constructor
+[Container creation](../../../modules/oracle-xe/src/test/java/org/testcontainers/junit/oracle/SimpleOracleTest.java) inside_block:container
+See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:oracle:21-slim-faststart:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:oracle-xe:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-oracle-xe:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- oracle-xe
+ testcontainers-oracle-xe{{latest_version}}test
diff --git a/docs/modules/databases/orientdb.md b/docs/modules/databases/orientdb.md
index 57839cd99f0..f3be7e2bbdb 100644
--- a/docs/modules/databases/orientdb.md
+++ b/docs/modules/databases/orientdb.md
@@ -1,46 +1,14 @@
# OrientDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-
-This module helps running [OrientDB](https://orientdb.org/download) using Testcontainers.
-
-Note that it's based on the [official Docker image](https://hub.docker.com/_/orientdb/) provided by OrientDB.
+Testcontainers module for [OrientDB](https://hub.docker.com/_/orientdb/)
## Usage example
-Declare your Testcontainers instance as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers.
-You can call `getDbUrl()` OrientDB container and build the `ODatabaseSession` by your own, but a more useful `getSession()` method is provided.
-On the JVM you would most likely use the [Java driver](https://github.com/).
-
-The following example uses the JUnit 5 extension `@Testcontainers` and demonstrates both the usage of the Java Client:
-
-=== "JUnit 5 example"
- ```java
- @Testcontainers
- public class ExampleTest {
-
- @Container
- private static OrientDBContainer container = new OrientDBContainer();
-
- @Test
- void testDbCreation() {
-
- final ODatabaseSession session = container.getSession();
-
- session.command("CREATE CLASS Person EXTENDS V");
- session.command("INSERT INTO Person set name='john'");
- session.command("INSERT INTO Person set name='jane'");
-
- assertThat(session.query("SELECT FROM Person").stream()).hasSize(2);
- }
-
- }
- ```
-
-You are not limited to Unit tests and can of course use an instance of the OrientDB Testcontainers implementation in vanilla Java code as well.
+You can start an OrientDB container instance from any Java application by using:
+
+[Container creation](../../../modules/orientdb/src/test/java/org/testcontainers/orientdb/OrientDBContainerTest.java) inside_block:container
+
## Adding this module to your project dependencies
@@ -48,13 +16,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:orientdb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-orientdb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- orientdb
+ testcontainers-orientdb{{latest_version}}test
diff --git a/docs/modules/databases/postgres.md b/docs/modules/databases/postgres.md
index b7632d78293..f27752b8354 100644
--- a/docs/modules/databases/postgres.md
+++ b/docs/modules/databases/postgres.md
@@ -1,20 +1,61 @@
# Postgres Module
+Testcontainers module for [PostgresSQL](https://hub.docker.com/_/postgres)
+
+## Usage example
+
+You can start a PostgreSQL container instance from any Java application by using:
+
+
+[Container creation](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/PostgreSQLContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+* PostgreSQL: `jdbc:tc:postgresql:9.6.8:///databasename`
+* PostGIS: `jdbc:tc:postgis:9.6-2.5:///databasename`
+* TimescaleDB: `jdbc:tc:timescaledb:2.1.0-pg13:///databasename`
+* PGvector: `jdbc:tc:pgvector:pg16:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Compatible images
+
+`PostgreSQLContainer` can also be used with the following images:
+
+* [pgvector/pgvector](https://hub.docker.com/r/pgvector/pgvector)
+
+
+[Using pgvector](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:pgvectorContainer
+
+
+* [postgis/postgis](https://registry.hub.docker.com/r/postgis/postgis)
+
+
+[Using PostGIS](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:postgisContainer
+
+
+* [timescale/timescaledb](https://hub.docker.com/r/timescale/timescaledb)
+
+
+[Using TimescaleDB](../../../modules/postgresql/src/test/java/org/testcontainers/postgresql/CompatibleImageTest.java) inside_block:timescaledbContainer
+
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:postgresql:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-postgresql:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- postgresql
+ testcontainers-postgresql{{latest_version}}test
diff --git a/docs/modules/databases/presto.md b/docs/modules/databases/presto.md
index d0a47fc1d7a..4e9a6e7c95d 100644
--- a/docs/modules/databases/presto.md
+++ b/docs/modules/databases/presto.md
@@ -69,13 +69,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:presto:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-presto:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- presto
+ testcontainers-presto{{latest_version}}test
diff --git a/docs/modules/databases/questdb.md b/docs/modules/databases/questdb.md
index 8783dd4b757..eb5c466f371 100644
--- a/docs/modules/databases/questdb.md
+++ b/docs/modules/databases/questdb.md
@@ -1,11 +1,24 @@
# QuestDB Module
-Testcontainers module for [QuestDB](https://github.com/questdb/questdb). QuestDB is a high-performance, open-source SQL
-database for applications in financial services, IoT, machine learning, DevOps and observability.
+Testcontainers module for [QuestDB](https://hub.docker.com/r/questdb/questdb)
+
+## Usage example
+
+You can start a QuestDB container instance from any Java application by using:
+
+
+[Container creation](../../../modules/questdb/src/test/java/org/testcontainers/junit/questdb/SimpleQuestDBTest.java) inside_block:container
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container
types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:questdb:6.5.3:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
@@ -13,7 +26,7 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:questdb:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-questdb:{{latest_version}}"
```
=== "Maven"
@@ -22,7 +35,7 @@ testImplementation "org.testcontainers:questdb:{{latest_version}}"
org.testcontainers
- questdb
+ testcontainers-questdb{{latest_version}}test
diff --git a/docs/modules/databases/r2dbc.md b/docs/modules/databases/r2dbc.md
index dba59b2d3d9..91580811887 100644
--- a/docs/modules/databases/r2dbc.md
+++ b/docs/modules/databases/r2dbc.md
@@ -12,7 +12,7 @@ As long as you have Testcontainers and the appropriate R2DBC driver on your clas
The started container will be terminated when the `ConnectionFactory` is closed.
!!! warning
- Both the database module (e.g. `org.testcontainers:mysql`) **and** `org.testcontainers:r2dbc` need to be on your application's classpath at runtime.
+ Both the database module (e.g. `org.testcontainers:testcontainers-mysql`) **and** `org.testcontainers:testcontainers-r2dbc` need to be on your application's classpath at runtime.
**Original URL**: `r2dbc:mysql://localhost:3306/databasename`
@@ -22,7 +22,7 @@ The started container will be terminated when the `ConnectionFactory` is closed.
**Note that, unlike Testcontainers' JDBC URL support, it is not possible to specify an image tag in the 'scheme' part of the URL, and it is always necessary to specify a tag using `TC_IMAGE_TAG`.**
So that the URL becomes:
-`r2dbc:tc:mysql:///databasename?TC_IMAGE_TAG=5.7.34`
+`r2dbc:tc:mysql:///databasename?TC_IMAGE_TAG=8.0.36`
!!! note
We will use `///` (host-less URIs) from now on to emphasis the unimportance of the `host:port` pair.
@@ -33,13 +33,17 @@ So that the URL becomes:
### R2DBC URL examples
+#### Using ClickHouse
+
+`r2dbc:tc:clickhouse:///databasename?TC_IMAGE_TAG=21.11.11-alpine`
+
#### Using MySQL
-`r2dbc:tc:mysql:///databasename?TC_IMAGE_TAG=5.7.34`
+`r2dbc:tc:mysql:///databasename?TC_IMAGE_TAG=8.0.36`
#### Using MariaDB
-`r2dbc:tc:mariadb:///databasename?TC_IMAGE_TAG=10.3.6`
+`r2dbc:tc:mariadb:///databasename?TC_IMAGE_TAG=10.3.39`
#### Using PostgreSQL
@@ -49,6 +53,10 @@ So that the URL becomes:
`r2dbc:tc:sqlserver:///?TC_IMAGE_TAG=2017-CU12`
+#### Using Oracle:
+
+`r2dbc:tc:oracle:///?TC_IMAGE_TAG=21-slim-faststart`
+
## Obtaining `ConnectionFactoryOptions` from database container objects
If you already have an instance of the database container, you can get an instance of `ConnectionFactoryOptions` from it:
diff --git a/docs/modules/databases/scylladb.md b/docs/modules/databases/scylladb.md
new file mode 100644
index 00000000000..bde40e3b599
--- /dev/null
+++ b/docs/modules/databases/scylladb.md
@@ -0,0 +1,58 @@
+# ScyllaDB
+
+Testcontainers module for [ScyllaDB](https://hub.docker.com/r/scylladb/scylla)
+
+## ScyllaDB's usage examples
+
+You can start a ScyllaDB container instance from any Java application by using:
+
+
+[Create container](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:container
+
+
+
+[Custom config file](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:customConfiguration
+
+
+### Building CqlSession
+
+
+[Using CQL port](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:session
+
+
+
+[Using SSL](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:sslContext
+
+
+
+[Using Shard Awareness port](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:shardAwarenessSession
+
+
+### Alternator
+
+
+[Enabling Alternator](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:alternator
+
+
+
+[DynamoDbClient with Alternator](../../../modules/scylladb/src/test/java/org/testcontainers/scylladb/ScyllaDBContainerTest.java) inside_block:dynamodDbClient
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-scylladb:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-scylladb
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/databases/tidb.md b/docs/modules/databases/tidb.md
index 01c6b4cfcd4..17cb66b21c3 100644
--- a/docs/modules/databases/tidb.md
+++ b/docs/modules/databases/tidb.md
@@ -1,21 +1,37 @@
# TiDB Module
+Testcontainers module for [TiDB](https://hub.docker.com/r/pingcap/tidb)
+
+## Usage example
+
+You can start a TiDB container instance from any Java application by using:
+
+
+[Container creation](../../../modules/tidb/src/test/java/org/testcontainers/tidb/TiDBContainerTest.java) inside_block:container
+
+
See [Database containers](./index.md) for documentation and usage that is common to all relational database container types.
+### Testcontainers JDBC URL
+
+`jdbc:tc:tidb:v6.1.0:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:tidb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-tidb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- tidb
+ testcontainers-tidb{{latest_version}}test
diff --git a/docs/modules/databases/timeplus.md b/docs/modules/databases/timeplus.md
new file mode 100644
index 00000000000..ee5e5767223
--- /dev/null
+++ b/docs/modules/databases/timeplus.md
@@ -0,0 +1,40 @@
+# Timeplus Module
+
+Testcontainers module for [Timeplus](https://hub.docker.com/r/timeplus/timeplusd)
+
+## Usage example
+
+You can start a Timeplus container instance from any Java application by using:
+
+
+[Container creation](../../../modules/timeplus/src/test/java/org/testcontainers/timeplus/TimeplusContainerTest.java) inside_block:container
+
+
+### Testcontainers JDBC URL
+
+`jdbc:tc:timeplus:2.3.21:///databasename`
+
+See [JDBC](./jdbc.md) for documentation.
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-timeplus:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-timeplus
+ {{latest_version}}
+ test
+
+ ```
+
+!!! hint
+ Adding this Testcontainers library JAR will not automatically add a database driver JAR to your project. You should ensure that your project also has a suitable database driver as a dependency.
+
diff --git a/docs/modules/databases/trino.md b/docs/modules/databases/trino.md
index b6aeddafb40..81fb4ea5b98 100644
--- a/docs/modules/databases/trino.md
+++ b/docs/modules/databases/trino.md
@@ -1,67 +1,22 @@
# Trino Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-See [Database containers](./index.md) for documentation and usage that is common to all database container types.
+Testcontainers module for [Trino](https://hub.docker.com/r/trinodb/trino)
## Usage example
-Running Trino as a stand-in for in a test:
-
-```java
-public class SomeTest {
-
- @Rule
- public TrinoContainer trino = new TrinoContainer();
-
- @Test
- public void someTestMethod() {
- String url = trino.getJdbcUrl();
+You can start a Trino container instance from any Java application by using:
- ... create a connection and run test as normal
-```
+
+[Container creation](../../../modules/trino/src/test/java/org/testcontainers/trino/TrinoContainerTest.java) inside_block:container
+
-Trino comes with several catalogs preconfigured. Most useful ones for testing are
-
-* `tpch` catalog using the [Trino TPCH Connector](https://trino.io/docs/current/connector/tpch.html).
- This is a read-only catalog that defines standard TPCH schema, so is available for querying without a need
- to create any tables.
-* `memory` catalog using the [Trino Memory Connector](https://trino.io/docs/current/connector/memory.html).
- This catalog can be used for creating schemas and tables and does not require any storage, as everything
- is stored fully in-memory.
-
-Example test using the `tpch` and `memory` catalogs:
+See [Database containers](./index.md) for documentation and usage that is common to all database container types.
-```java
-public class SomeTest {
- @Rule
- public TrinoContainer trino = new TrinoContainer();
+### Testcontainers JDBC URL
- @Test
- public void queryMemoryAndTpchConnectors() throws SQLException {
- try (Connection connection = trino.createConnection();
- Statement statement = connection.createStatement()) {
- // Prepare data
- statement.execute("CREATE TABLE memory.default.table_with_array AS SELECT 1 id, ARRAY[1, 42, 2, 42, 4, 42] my_array");
+`jdbc:tc:trino:352:///defaultname`
- // Query Trino using newly created table and a builtin connector
- try (ResultSet resultSet = statement.executeQuery("" +
- "SELECT nationkey, element " +
- "FROM tpch.tiny.nation " +
- "JOIN memory.default.table_with_array twa ON nationkey = twa.id " +
- "LEFT JOIN UNNEST(my_array) a(element) ON true " +
- "ORDER BY element OFFSET 1 FETCH NEXT 3 ROWS WITH TIES ")) {
- List actualElements = new ArrayList<>();
- while (resultSet.next()) {
- actualElements.add(resultSet.getInt("element"));
- }
- Assert.assertEquals(Arrays.asList(2, 4, 42, 42, 42), actualElements);
- }
- }
- }
-}
-```
+See [JDBC](./jdbc.md) for documentation.
## Adding this module to your project dependencies
@@ -69,14 +24,14 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:trino:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-trino:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- trino
+ testcontainers-trino{{latest_version}}test
diff --git a/docs/modules/databases/yugabytedb.md b/docs/modules/databases/yugabytedb.md
index 4ab3436b57c..4409712241b 100644
--- a/docs/modules/databases/yugabytedb.md
+++ b/docs/modules/databases/yugabytedb.md
@@ -1,11 +1,11 @@
# YugabyteDB Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+Testcontainers module for [YugabyteDB](https://hub.docker.com/r/yugabytedb/yugabyte)
See [Database containers](./index.md) for documentation and usage that is common to all database container types.
-YugabyteDB supports two APIs.
+YugabyteDB supports two APIs.
+
- Yugabyte Structured Query Language [YSQL](https://docs.yugabyte.com/latest/api/ysql/) is a fully-relational API that is built by the PostgreSQL code
- Yugabyte Cloud Query Language [YCQL](https://docs.yugabyte.com/latest/api/ycql/) is a semi-relational SQL API that has its roots in the Cassandra Query Language
@@ -17,11 +17,11 @@ YugabyteDB supports two APIs.
[Creating a YSQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYSQLTest.java) inside_block:creatingYSQLContainer
+### Testcontainers JDBC URL
-
-[Starting a YSQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYSQLTest.java) inside_block:startingYSQLContainer
-
+`jdbc:tc:yugabyte:2.14.4.0-b26:///databasename`
+See [JDBC](./jdbc.md) for documentation.
### YCQL API
@@ -30,24 +30,19 @@ YugabyteDB supports two APIs.
-
-[Starting a YCQL container](../../../modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYCQLTest.java) inside_block:startingYCQLContainer
-
-
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:yugabytedb:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-yugabytedb:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- yugabytedb
+ testcontainers-yugabytedb{{latest_version}}test
diff --git a/docs/modules/docker_compose.md b/docs/modules/docker_compose.md
index 50bb946f311..3d3d7a510c2 100644
--- a/docs/modules/docker_compose.md
+++ b/docs/modules/docker_compose.md
@@ -2,125 +2,121 @@
## Benefits
-Similar to generic containers support, it's also possible to run a bespoke set of services
-specified in a `docker-compose.yml` file.
+Similar to generic container support, it's also possible to run a bespoke set of services specified in a
+`docker-compose.yml` file.
-This is intended to be useful on projects where Docker Compose is already used in dev or other environments to define
-services that an application may be dependent upon.
+This is especially useful for projects where Docker Compose is already used in development
+or other environments to define services that an application may be dependent upon.
-Behind the scenes, Testcontainers actually launches a temporary Docker Compose client - in a container, of course, so
-it's not necessary to have it installed on all developer/test machines.
+The `ComposeContainer` leverages [Compose V2](https://www.docker.com/blog/announcing-compose-v2-general-availability/),
+making it easy to use the same dependencies from the development environment within tests.
## Example
-A single class rule, pointing to a `docker-compose.yml` file, should be sufficient to launch any number of services
-required by your tests:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT)
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT);
-```
+A single class `ComposeContainer`, defined based on a `docker-compose.yml` file,
+should be sufficient to launch any number of services required by our tests:
+
+
+[Create a ComposeContainer](../../core/src/test/java/org/testcontainers/junit/ComposeContainerTest.java) inside_block:composeContainerConstructor
+
+
+!!! note
+ Make sure the service names use a `-` rather than `_` as separator.
-In this example, `compose-test.yml` should have content such as:
+In this example, Docker Compose file should have content such as:
```yaml
-redis:
- image: redis
-elasticsearch:
- image: elasticsearch
+services:
+ redis:
+ image: redis
+ db:
+ image: mysql:8.0.36
```
-Note that it is not necessary to define ports to be exposed in the YAML file; this would inhibit reuse/inclusion of the
-file in other contexts.
+Note that it is not necessary to define ports to be exposed in the YAML file,
+as this would inhibit the reuse/inclusion of the file in other contexts.
+
+Instead, Testcontainers will spin up a small `ambassador` container,
+which will proxy between the Compose-managed containers and ports that are accessible to our tests.
+
+## ComposeContainer vs DockerComposeContainer
+
+So far, we discussed `ComposeContainer`, which supports docker compose [version 2](https://www.docker.com/blog/announcing-compose-v2-general-availability/).
-Instead, Testcontainers will spin up a small 'ambassador' container, which will proxy
-between the Compose-managed containers and ports that are accessible to your tests. This is done using a separate, minimal
-container that runs socat as a TCP proxy.
+On the other hand, `DockerComposeContainer` utilizes Compose V1, which has been marked deprecated by Docker.
-## Accessing a container from tests
+The two APIs are quite similar, and most examples provided on this page can be applied to both of them.
-The rule provides methods for discovering how your tests can interact with the containers:
+## Accessing a Container
+
+`ComposeContainer` provides methods for discovering how your tests can interact with the containers:
* `getServiceHost(serviceName, servicePort)` returns the IP address where the container is listening (via an ambassador
container)
* `getServicePort(serviceName, servicePort)` returns the Docker mapped port for a port that has been exposed (via an
ambassador container)
-For example, with the Redis example above, the following will allow your tests to access the Redis service:
-```java
-String redisUrl = environment.getServiceHost("redis_1", REDIS_PORT)
- + ":" +
- environment.getServicePort("redis_1", REDIS_PORT);
-```
+Let's use this API to create the URL that will enable our tests to access the Redis service:
+
+[Access a Service's host and port](../../core/src/test/java/org/testcontainers/junit/ComposeContainerTest.java) inside_block:getServiceHostAndPort
+
-## Startup timeout
+## Wait Strategies and Startup Timeouts
Ordinarily Testcontainers will wait for up to 60 seconds for each exposed container's first mapped network port to start listening.
-
This simple measure provides a basic check whether a container is ready for use.
-There are overloaded `withExposedService` methods that take a `WaitStrategy` so you can specify a timeout strategy per container.
+There are overloaded `withExposedService` methods that take a `WaitStrategy`
+where we can specify a timeout strategy per container.
-### Waiting for startup examples
+We can either use the fluent API to crate a [custom strategy](../features/startup_and_waits.md) or use one of the already existing ones,
+accessible via the static factory methods from of the `Wait` class.
-Waiting for exposed port to start listening:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT,
- Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(30)));
-```
+For instance, we can wait for exposed port and set a custom timeout:
+
+[Wait for the exposed port and use a custom timeout](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWaitForPortWithTimeout
+
-Wait for arbitrary status codes on an HTTPS endpoint:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT,
- Wait.forHttp("/all")
- .forStatusCode(200)
- .forStatusCode(401)
- .usingTls());
-```
+Needless to say, we can define different strategies for each service in our Docker Compose setup.
-Separate wait strategies for each container:
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .withExposedService("elasticsearch_1", ELASTICSEARCH_PORT,
- Wait.forHttp("/all")
- .forStatusCode(200)
- .forStatusCode(401)
- .usingTls());
-```
+For example, our Redis container can wait for a successful redis-cli command,
+while our db service waits for a specific log message:
-Alternatively, you can use `waitingFor(serviceName, waitStrategy)`,
-for example if you need to wait on a log message from a service, but don't need to expose a port.
+
+[Wait for a custom command and a log message](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategiesTest.java) inside_block:composeContainerWithCombinedWaitStrategies
+
-```java
-@ClassRule
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .waitingFor("db_1", Wait.forLogMessage("started", 1));
-```
-## 'Local compose' mode
-You can override Testcontainers' default behaviour and make it use a `docker-compose` binary installed on the local machine.
-This will generally yield an experience that is closer to running docker-compose locally, with the caveat that Docker Compose needs to be present on dev and CI machines.
-```java
-public static DockerComposeContainer environment =
- new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
- .withExposedService("redis_1", REDIS_PORT, Wait.forListeningPort())
- .waitingFor("db_1", Wait.forLogMessage("started", 1))
- .withLocalCompose(true);
-```
+## The 'Local Compose' Mode
+
+We can override Testcontainers' default behaviour and make it use a `docker-compose` binary installed on the local machine.
+
+This will generally yield an experience that is closer to running _docker compose_ locally,
+with the caveat that Docker Compose needs to be present on dev and CI machines.
+
+
+[Use ComposeContainer in 'Local Compose' mode](../../core/src/test/java/org/testcontainers/containers/ComposeProfilesOptionTest.java) inside_block:composeContainerWithLocalCompose
+
+
+## Build Working Directory
+
+We can select what files should be copied only via `withCopyFilesInContainer`:
+
+
+[Use ComposeContainer in 'Local Compose' mode](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithCopyFilesTest.java) inside_block:composeContainerWithCopyFiles
+
+
+In this example, only docker compose and env files are copied over into the container that will run the Docker Compose file.
+By default, all files in the same directory as the compose file are copied over.
+
+We can use file and directory references.
+They are always resolved relative to the directory where the compose file resides.
+
+!!! note
+ This can be used with `DockerComposeContainer` and `ComposeContainer`, but **only in the containerized Compose (not with `Local Compose` mode)**.
+
## Using private repositories in Docker compose
-When Docker Compose is used in container mode (not local), it's needs to be made aware of Docker settings for private repositories.
+When Docker Compose is used in container mode (not local), it needs to be made aware of Docker
+settings for private repositories.
By default, those setting are located in `$HOME/.docker/config.json`.
There are 3 ways to specify location of the `config.json` for Docker Compose:
diff --git a/docs/modules/docker_mcp_gateway.md b/docs/modules/docker_mcp_gateway.md
new file mode 100644
index 00000000000..af526bab3fe
--- /dev/null
+++ b/docs/modules/docker_mcp_gateway.md
@@ -0,0 +1,32 @@
+# Docker MCP Gateway
+
+Testcontainers module for [Docker MCP Gateway](https://hub.docker.com/r/docker/mcp-gateway).
+
+## DockerMcpGatewayContainer's usage examples
+
+You can start a Docker MCP Gateway container instance from any Java application by using:
+
+
+[Create a DockerMcpGatewayContainer](../../core/src/test/java/org/testcontainers/containers/DockerMcpGatewayContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+*Docker MCP Gateway support is part of the core Testcontainers library.*
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers
+ {{latest_version}}
+ test
+
+ ```
+
diff --git a/docs/modules/docker_model_runner.md b/docs/modules/docker_model_runner.md
new file mode 100644
index 00000000000..b610279e93b
--- /dev/null
+++ b/docs/modules/docker_model_runner.md
@@ -0,0 +1,41 @@
+# Docker Model Runner
+
+This module helps connect to [Docker Model Runner](https://docs.docker.com/desktop/features/model-runner/)
+provided by Docker Desktop 4.40.0.
+
+## DockerModelRunner's usage examples
+
+You can start a Docker Model Runner proxy container instance from any Java application by using:
+
+
+[Create a DockerModelRunnerContainer](../../core/src/test/java/org/testcontainers/containers/DockerModelRunnerContainerTest.java) inside_block:container
+
+
+### Pulling the model
+
+Pulling the model is as simple as:
+
+
+[Pull model](../../core/src/test/java/org/testcontainers/containers/DockerModelRunnerContainerTest.java) inside_block:pullModel
+
+
+## Adding this module to your project dependencies
+
+*Docker Model Runner support is part of the core Testcontainers library.*
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers
+ {{latest_version}}
+ test
+
+ ```
+
diff --git a/docs/modules/elasticsearch.md b/docs/modules/elasticsearch.md
index 845ee0d2d1a..5817a21de02 100644
--- a/docs/modules/elasticsearch.md
+++ b/docs/modules/elasticsearch.md
@@ -10,7 +10,9 @@ Note that it's based on the [official Docker image](https://www.elastic.co/guide
You can start an elasticsearch container instance from any Java application by using:
-[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer
+[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer7
+[HttpClient with Elasticsearch 8](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainer8
+[HttpClient with Elasticsearch 8 and SSL disabled](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientContainerNoSSL8
[TransportClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:transportClientContainer
@@ -28,29 +30,47 @@ You can turn on security by providing a password:
[HttpClient](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:httpClientSecuredContainer
-## Choose your Elasticsearch license
+## Kibana container
-If you prefer to start a Docker image with the pure OSS version (which means with no security in older versions or
-other new and advanced features), you can use this instead:
+This module also provides a `KibanaContainer` for testing with [Kibana](https://www.elastic.co/kibana).
+Kibana requires a connection to Elasticsearch and `KibanaContainer` supports two modes: managed and external.
+
+### Managed mode
+
+In managed mode, `KibanaContainer` automatically connects to an `ElasticsearchContainer`:
-[Elasticsearch OSS](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java) inside_block:ossContainer
+[Kibana with Elasticsearch](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java) inside_block:managedModeCanStartAndReachElasticsearchInSameExplicitNetwork
+When using managed mode with explicit networks, both containers must share the same `Network` instance.
+Alternatively, you can omit the network configuration entirely, and `KibanaContainer` will do its best effort to create a shared, ad-hoc network automatically.
+
+### External mode
+
+In external mode, `KibanaContainer` connects to an external Elasticsearch instance via URL and using provided credentials:
+
+
+[Kibana with external Elasticsearch](../../modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/KibanaContainerTest.java) inside_block:externalModeCanWorkWithUsernamePassword
+
+
+For external mode with HTTPS, use `withElasticsearchCaCertificate()` to provide the CA certificate.
+You can authenticate using either username/password (`withElasticsearchCredentials()`) or service account tokens (`withElasticsearchServiceAccountToken()`).
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:elasticsearch:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-elasticsearch:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- elasticsearch
+ testcontainers-elasticsearch{{latest_version}}test
diff --git a/docs/modules/gcloud.md b/docs/modules/gcloud.md
index 807b81de433..9660461d5a0 100644
--- a/docs/modules/gcloud.md
+++ b/docs/modules/gcloud.md
@@ -5,36 +5,49 @@
Testcontainers module for the Google Cloud Platform's [Cloud SDK](https://cloud.google.com/sdk/).
-Currently, the module supports `Bigtable`, `Datastore`, `Firestore`, `Spanner`, and `Pub/Sub` emulators. In order to use it, you should use the following classes:
+Currently, the module supports `BigQuery`, `Bigtable`, `Datastore`, `Firestore`, `Spanner`, and `Pub/Sub` emulators. In order to use it, you should use the following classes:
Class | Container Image
-|-
-BigtableEmulatorContainer | [gcr.io/google.com/cloudsdktool/cloud-sdk:emulators](https://gcr.io/google.com/cloudsdktool/cloud-sdk)
-DatastoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/cloud-sdk:emulators](https://gcr.io/google.com/cloudsdktool/cloud-sdk)
-FirestoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/cloud-sdk:emulators](https://gcr.io/google.com/cloudsdktool/cloud-sdk)
+BigQueryEmulatorContainer | [ghcr.io/goccy/bigquery-emulator](https://ghcr.io/goccy/bigquery-emulator)
+BigtableEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
+DatastoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
+FirestoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
SpannerEmulatorContainer | [gcr.io/cloud-spanner-emulator/emulator](https://gcr.io/cloud-spanner-emulator/emulator)
-PubSubEmulatorContainer | [gcr.io/google.com/cloudsdktool/cloud-sdk:emulators](https://gcr.io/google.com/cloudsdktool/cloud-sdk)
+PubSubEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)
## Usage example
+### BigQuery
+
+Start BigQuery Emulator during a test:
+
+
+[Starting a BigQuery Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigQueryEmulatorContainerTest.java) inside_block:emulatorContainer
+
+
+
+[Creating BigQuery Client](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigQueryEmulatorContainerTest.java) inside_block:bigQueryClient
+
+
### Bigtable
Start Bigtable Emulator during a test:
-[Starting a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Bigtable table in the Emulator:
-[Create a test table](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:createTable
+[Create a test table](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:createTable
Test against the Emulator:
-[Testing with a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/BigtableEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Bigtable Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/BigtableEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
### Datastore
@@ -42,18 +55,18 @@ Test against the Emulator:
Start Datastore Emulator during a test:
-[Starting a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java) inside_block:creatingDatastoreEmulatorContainer
+[Starting a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java) inside_block:creatingDatastoreEmulatorContainer
And test against the Emulator:
-[Testing with a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java) inside_block:startingDatastoreEmulatorContainer
+[Testing with a Datastore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java) inside_block:startingDatastoreEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/DatastoreEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/DatastoreEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/datastore-example/src/test/java/com/example/springboot/datastore)
### Firestore
@@ -61,18 +74,18 @@ See more examples:
Start Firestore Emulator during a test:
-[Starting a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java) inside_block:emulatorContainer
And test against the Emulator:
-[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/FirestoreEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/FirestoreEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/firestore-example/src/test/java/com/example/springboot/firestore/FirestoreIntegrationTests.java)
### Spanner
@@ -80,30 +93,30 @@ See more examples:
Start Spanner Emulator during a test:
-[Starting a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Spanner Instance in the Emulator:
-[Create a test Spanner instance](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:createInstance
+[Create a test Spanner instance](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:createInstance
Create a test Database in the Emulator:
-[Creating a test Spanner database](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:createDatabase
+[Creating a test Spanner database](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:createDatabase
And test against the Emulator:
-[Testing with a Firestore Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Spanner Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/SpannerEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/SpannerEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/spanner-example/src/test/java/com/example/springboot/spanner/SpannerIntegrationTests.java)
### Pub/Sub
@@ -111,30 +124,30 @@ See more examples:
Start Pub/Sub Emulator during a test:
-[Starting a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:emulatorContainer
+[Starting a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:emulatorContainer
Create a test Pub/Sub topic in the Emulator:
-[Create a test topic](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:createTopic
+[Create a test topic](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:createTopic
Create a test Pub/Sub subscription in the Emulator:
-[Create a test subscription](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:createSubscription
+[Create a test subscription](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:createSubscription
And test against the Emulator:
-[Testing with a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
+[Testing with a Pub/Sub Emulator container](../../modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java) inside_block:testWithEmulatorContainer
See more examples:
- * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/containers/PubSubEmulatorContainerTest.java)
+ * [Full sample code](https://github.com/testcontainers/testcontainers-java/tree/main/modules/gcloud/src/test/java/org/testcontainers/gcloud/PubSubEmulatorContainerTest.java)
* [With Spring Boot](https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot/pubsub-example/src/test/java/com/example/springboot/pubsub/PubSubIntegrationTests.java)
## Adding this module to your project dependencies
@@ -143,13 +156,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:gcloud:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-gcloud:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- gcloud
+ testcontainers-gcloud{{latest_version}}test
diff --git a/docs/modules/grafana.md b/docs/modules/grafana.md
new file mode 100644
index 00000000000..397ade89ee3
--- /dev/null
+++ b/docs/modules/grafana.md
@@ -0,0 +1,30 @@
+# Grafana
+
+Testcontainers module for [Grafana OTel LGTM](https://hub.docker.com/r/grafana/otel-lgtm).
+
+## LGTM's usage examples
+
+You can start a Grafana OTel LGTM container instance from any Java application by using:
+
+
+[Grafana Otel LGTM container](../../modules/grafana/src/test/java/org/testcontainers/grafana/LgtmStackContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-grafana:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-grafana
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/hivemq.md b/docs/modules/hivemq.md
index 66f9670648c..8bba4c18b36 100644
--- a/docs/modules/hivemq.md
+++ b/docs/modules/hivemq.md
@@ -1,8 +1,8 @@
# HiveMQ Module
-
+
-Automatic starting HiveMQ docker containers for JUnit4 and JUnit5 tests.
+Automatic starting HiveMQ docker containers for JUnit5 tests.
This enables testing MQTT client applications and integration testing of custom HiveMQ extensions.
- Community forum: https://community.hivemq.com/
@@ -34,7 +34,7 @@ Using the Enterprise Edition:
[Enterprise Edition HiveMQ image](../../modules/hivemq/src/test/java/org/testcontainers/hivemq/docs/DemoHiveMQContainerIT.java) inside_block:hiveEEVersion
-Using a specifc version is possible by using the tag:
+Using a specific version is possible by using the tag:
[Specific HiveMQ Version](../../modules/hivemq/src/test/java/org/testcontainers/hivemq/docs/DemoHiveMQContainerIT.java) inside_block:specificVersion
@@ -151,7 +151,7 @@ If the extension folder contains a DISABLED file, the extension will be disabled
---
-We first load the extension from the filesytem:
+We first load the extension from the filesystem:
[Extension from filesystem](../../modules/hivemq/src/test/java/org/testcontainers/hivemq/docs/DemoDisableExtensionsIT.java) inside_block:startFromFilesystem
@@ -212,13 +212,13 @@ can be customized as desired.
Add to `build.gradle`:
````groovy
-testImplementation 'org.testcontainers:hivemq:{{latest_version}}'
+testImplementation 'org.testcontainers:testcontainers-hivemq:{{latest_version}}'
````
Add to `build.gradle.kts`:
````kotlin
-testImplementation("org.testcontainers:hivemq:{{latest_version}}")
+testImplementation("org.testcontainers:testcontainers-hivemq:{{latest_version}}")
````
### Maven
@@ -228,7 +228,7 @@ Add to `pom.xml`:
```xml
org.testcontainers
- hivemq
+ testcontainers-hivemq{{latest_version}}test
diff --git a/docs/modules/k3s.md b/docs/modules/k3s.md
index 27d2f863122..a9de1b3fd4f 100644
--- a/docs/modules/k3s.md
+++ b/docs/modules/k3s.md
@@ -35,19 +35,22 @@ This may be used with Kubernetes clients - e.g. for the [official Java client](c
* k3s containers may be unable to run on host machines where `/var/lib/docker` is on a BTRFS filesystem. See [k3s-io/k3s#4863](https://github.com/k3s-io/k3s/issues/4863) for an example.
+ * You may experience PKIX exceptions when trying to use a configured Fabric8 client. This is down to newer distributions of k3s issuing elliptic curve keys.
+ This can be fixed by adding [BouncyCastle PKI library](https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on) to your classpath.
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:k3s:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-k3s:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- k3s
+ testcontainers-k3s{{latest_version}}test
diff --git a/docs/modules/k6.md b/docs/modules/k6.md
new file mode 100644
index 00000000000..13e0ddc9252
--- /dev/null
+++ b/docs/modules/k6.md
@@ -0,0 +1,50 @@
+# k6 Module
+
+!!! note
+ This module is INCUBATING.
+ While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future.
+ See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
+
+Testcontainers module for [k6](https://registry.hub.docker.com/r/grafana/k6).
+
+[k6](https://k6.io/) is an extensible reliability testing tool built for developer happiness.
+
+## Basic script execution
+
+You can start a K6 container instance from any Java application by using:
+
+
+[Setup the container](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:standard_k6
+
+
+The test above uses a simple k6 script, `test.js`, with command line options and an injected script variable.
+
+Once the container is started, you can wait for the test results to be collected:
+
+
+[Wait for test results](../../modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java) inside_block:wait
+
+
+Create a simple k6 test script to be executed as part of your tests:
+
+
+[Content of `scripts/test.js`](../../modules/k6/src/test/resources/scripts/test.js) inside_block:access_script_vars
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-k6:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-k6
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/kafka.md b/docs/modules/kafka.md
index 9b222cef125..cb2906265d0 100644
--- a/docs/modules/kafka.md
+++ b/docs/modules/kafka.md
@@ -1,50 +1,84 @@
-# Kafka Containers
+# Kafka Module
Testcontainers can be used to automatically instantiate and manage [Apache Kafka](https://kafka.apache.org) containers.
-More precisely Testcontainers uses the official Docker images for [Confluent OSS Platform](https://hub.docker.com/r/confluentinc/cp-kafka/)
+
+Currently, two different Kafka images are supported:
+
+* `org.testcontainers.kafka.ConfluentKafkaContainer` supports
+[confluentinc/cp-kafka](https://hub.docker.com/r/confluentinc/cp-kafka/)
+* `org.testcontainers.kafka.KafkaContainer` supports [apache/kafka](https://hub.docker.com/r/apache/kafka/) and [apache/kafka-native](https://hub.docker.com/r/apache/kafka-native/)
+
+!!! note
+ `org.testcontainers.containers.KafkaContainer` is deprecated.
+ Please use `org.testcontainers.kafka.ConfluentKafkaContainer` or `org.testcontainers.kafka.KafkaContainer` instead, depending on the used image.
## Benefits
* Running a single node Kafka installation with just one line of code
-* No need to manage external Zookeeper installation, required by Kafka. But see [below](#zookeeper)
+* No need to manage external Zookeeper installation, required by Kafka.
## Example
+### Using org.testcontainers.kafka.KafkaContainer
+
Create a `KafkaContainer` to use it in your tests:
+
-[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:constructorWithVersion
+[Creating a KafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:constructorWithVersion
-The correspondence between Confluent Platform versions and Kafka versions can be seen [in Confluent documentation](https://docs.confluent.io/current/installation/versions-interoperability.html#cp-and-apache-kafka-compatibility)
-
Now your tests or any other process running on your machine can get access to running Kafka broker by using the following bootstrap server location:
[Bootstrap Servers](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:getBootstrapServers
+### Using org.testcontainers.kafka.ConfluentKafkaContainer
+
+!!! note
+ Compatible with `confluentinc/cp-kafka` images version `7.4.0` and later.
+
+Create a `ConfluentKafkaContainer` to use it in your tests:
+
+
+[Creating a ConfluentKafkaContainer](../../modules/kafka/src/test/java/org/testcontainers/kafka/ConfluentKafkaContainerTest.java) inside_block:constructorWithVersion
+
+
## Options
-### Using external Zookeeper
+### Using Kraft mode
+
+!!! note
+ Only available for `org.testcontainers.containers.KafkaContainer`
+
+KRaft mode was declared production ready in 3.3.1 (confluentinc/cp-kafka:7.3.x)
-If for some reason you want to use an externally running Zookeeper, then just pass its location during construction:
-[External Zookeeper](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:withExternalZookeeper
+[Kraft mode](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:withKraftMode
+See the [versions interoperability matrix](https://docs.confluent.io/platform/current/installation/versions-interoperability.html) for more details.
+
+### Register listeners
+
+There are scenarios where additional listeners are needed because the consumer/producer can be in another
+container in the same network or a different process where the port to connect differs from the default exposed port. E.g [Toxiproxy](../../modules/toxiproxy/).
-## Multi-container usage
+
+[Register additional listener](../../modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java) inside_block:registerListener
+
-If your test needs to run some other Docker container which needs access to Kafka, do the following:
+Container defined in the same network:
-* Run your other container on the same network as Kafka container, e.g.:
-[Network](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:withKafkaNetwork
+[Create kcat container](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:createKCatContainer
-* Use `kafka.getNetworkAliases().get(0)+":9092"` as bootstrap server location.
-Or just give your Kafka container a network alias of your liking.
-You will need to explicitly create a network and set it on the Kafka container as well as on your other containers that need to communicate with Kafka.
+Client using the new registered listener:
+
+
+[Produce/Consume via new listener](../../modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java) inside_block:produceConsumeMessage
+
## Adding this module to your project dependencies
@@ -52,13 +86,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:kafka:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-kafka:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- kafka
+ testcontainers-kafka{{latest_version}}test
diff --git a/docs/modules/ldap.md b/docs/modules/ldap.md
new file mode 100644
index 00000000000..c84469f22ae
--- /dev/null
+++ b/docs/modules/ldap.md
@@ -0,0 +1,30 @@
+# LDAP
+
+Testcontainers module for [LLDAP](https://hub.docker.com/r/lldap/lldap).
+
+## LLdapContainer's usage examples
+
+You can start a LLDAP container instance from any Java application by using:
+
+
+[LLDAP container](../../modules/ldap/src/test/java/org/testcontainers/ldap/LLdapContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-ldap:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-ldap
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/localstack.md b/docs/modules/localstack.md
index b6c82ccf67a..ca51979f5a0 100644
--- a/docs/modules/localstack.md
+++ b/docs/modules/localstack.md
@@ -4,48 +4,26 @@ Testcontainers module for [LocalStack](http://localstack.cloud/), 'a fully funct
## Usage example
-Running LocalStack as a stand-in for AWS S3 during a test:
-
-```java
-DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:0.11.3");
-
-@Rule
-public LocalStackContainer localstack = new LocalStackContainer(localstackImage)
- .withServices(S3);
-```
-
-## Creating a client using AWS SDK
-
-
-[AWS SDK V1](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_aws_sdk_v1
-
+You can start a LocalStack container instance from any Java application by using:
-[AWS SDK V2](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_aws_sdk_v2
+[Container creation](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:container
-Environment variables listed in [Localstack's README](https://github.com/localstack/localstack#configurations) may be used to customize Localstack's configuration.
+Environment variables listed in the [LocalStack configuration documentation](https://docs.localstack.cloud/references/configuration/) may be used to customize LocalStack's configuration.
Use the `.withEnv(key, value)` method on `LocalStackContainer` to apply configuration settings.
-## `HOSTNAME_EXTERNAL` and hostname-sensitive services
+!!! note
+ Starting March 23, 2026, `localstack/localstack` requires authentication via a `LOCALSTACK_AUTH_TOKEN` environment variable. Without it, the container will fail to start.
-Some Localstack APIs, such as SQS, require the container to be aware of the hostname that it is accessible on - for example, for construction of queue URLs in responses.
+ Use `.withEnv("LOCALSTACK_AUTH_TOKEN", System.getenv("LOCALSTACK_AUTH_TOKEN"))` to pass the token.
+ See the [LocalStack blog post](https://blog.localstack.cloud/localstack-single-image-next-steps/) for more details.
-Testcontainers will inform Localstack of the best hostname automatically, using the `HOSTNAME_EXTERNAL` environment variable:
-
-* when running the Localstack container directly without a custom network defined, it is expected that all calls to the container will be from the test host. As such, the container address will be used (typically localhost or the address where the Docker daemon is running).
-
-
- [Localstack container running without a custom network](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:without_network
-
-
-* when running the Localstack container [with a custom network defined](/features/networking/#advanced-networking), it is expected that all calls to the container will be **from other containers on that network**. `HOSTNAME_EXTERNAL` will be set to the *last* network alias that has been configured for the Localstack container.
-
-
- [Localstack container running with a custom network](../../modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java) inside_block:with_network
-
+## Creating a client using AWS SDK
-* Other usage scenarios, such as where the Localstack container is used from both the test host and containers on a custom network are not automatically supported. If you have this use case, you should set `HOSTNAME_EXTERNAL` manually.
+
+[AWS SDK V2](../../modules/localstack/src/test/java/org/testcontainers/localstack/LocalStackContainerTest.java) inside_block:with_aws_sdk_v2
+
## Adding this module to your project dependencies
@@ -53,13 +31,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:localstack:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-localstack:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- localstack
+ testcontainers-localstack{{latest_version}}test
diff --git a/docs/modules/milvus.md b/docs/modules/milvus.md
new file mode 100644
index 00000000000..96772560f80
--- /dev/null
+++ b/docs/modules/milvus.md
@@ -0,0 +1,36 @@
+# Milvus
+
+Testcontainers module for [Milvus](https://hub.docker.com/r/milvusdb/milvus).
+
+## Milvus's usage examples
+
+You can start a Milvus container instance from any Java application by using:
+
+
+[Default config](../../modules/milvus/src/test/java/org/testcontainers/milvus/MilvusContainerTest.java) inside_block:milvusContainer
+
+
+With external Etcd:
+
+
+[External Etcd](../../modules/milvus/src/test/java/org/testcontainers/milvus/MilvusContainerTest.java) inside_block:externalEtcd
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-milvus:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-milvus
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/minio.md b/docs/modules/minio.md
new file mode 100644
index 00000000000..165f760425c
--- /dev/null
+++ b/docs/modules/minio.md
@@ -0,0 +1,39 @@
+# MinIO Containers
+
+Testcontainers can be used to automatically instantiate and manage [MinIO](https://min.io) containers.
+
+## Usage example
+
+Create a `MinIOContainer` to use it in your tests:
+
+[Starting a MinIO container](../../modules/minio/src/test/java/org/testcontainers/containers/MinIOContainerTest.java) inside_block:minioContainer
+
+
+The [MinIO Java client](https://min.io/docs/minio/linux/developers/java/API.html) can be configured with the container as such:
+
+[Configuring a MinIO client](../../modules/minio/src/test/java/org/testcontainers/containers/MinIOContainerTest.java) inside_block:configuringClient
+
+
+If needed the username and password can be overridden as such:
+
+[Overriding a MinIO container](../../modules/minio/src/test/java/org/testcontainers/containers/MinIOContainerTest.java) inside_block:minioOverrides
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-minio:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-minio
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/mockserver.md b/docs/modules/mockserver.md
index c739278acff..e6a0ee91ece 100644
--- a/docs/modules/mockserver.md
+++ b/docs/modules/mockserver.md
@@ -7,13 +7,13 @@ Mock Server can be used to mock HTTP services by matching requests against user-
The following example shows how to start Mockserver.
-[Creating a MockServer container](../../modules/mockserver/src/test/java/org/testcontainers/containers/MockServerContainerRuleTest.java) inside_block:creatingProxy
+[Creating a MockServer container](../../modules/mockserver/src/test/java/org/testcontainers/mockserver/MockServerContainerTest.java) inside_block:creatingProxy
And how to set a simple expectation using the Java MockServerClient.
-[Setting a simple expectation](../../modules/mockserver/src/test/java/org/testcontainers/containers/MockServerContainerRuleTest.java) inside_block:testSimpleExpectation
+[Setting a simple expectation](../../modules/mockserver/src/test/java/org/testcontainers/mockserver/MockServerContainerTest.java) inside_block:testSimpleExpectation
## Adding this module to your project dependencies
@@ -22,13 +22,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:mockserver:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-mockserver:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- mockserver
+ testcontainers-mockserver{{latest_version}}test
diff --git a/docs/modules/nginx.md b/docs/modules/nginx.md
index fb4270ba4a3..6fcdbdaf13f 100644
--- a/docs/modules/nginx.md
+++ b/docs/modules/nginx.md
@@ -7,19 +7,19 @@ Nginx is a web server, reverse proxy and mail proxy and http cache.
The following example shows how to start Nginx.
-[Creating a Nginx container](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:creatingContainer
+[Creating a Nginx container](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:creatingContainer
How to add custom content to the Nginx server.
-[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:addCustomContent
+[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:addCustomContent
And how to query the Nginx server for the custom content added.
-[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/junit/SimpleNginxTest.java) inside_block:getFromNginxServer
+[Creating the static content to serve](../../modules/nginx/src/test/java/org/testcontainers/nginx/NginxContainerTest.java) inside_block:getFromNginxServer
## Adding this module to your project dependencies
@@ -28,13 +28,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:nginx:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-nginx:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- nginx
+ testcontainers-nginx{{latest_version}}test
diff --git a/docs/modules/ollama.md b/docs/modules/ollama.md
new file mode 100644
index 00000000000..56c1574d4db
--- /dev/null
+++ b/docs/modules/ollama.md
@@ -0,0 +1,52 @@
+# Ollama
+
+Testcontainers module for [Ollama](https://hub.docker.com/r/ollama/ollama) .
+
+## Ollama's usage examples
+
+You can start an Ollama container instance from any Java application by using:
+
+
+[Ollama container](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:container
+
+
+### Pulling the model
+
+Testcontainers allows [executing commands in the container](../features/commands.md). So, pulling the model is as simple as:
+
+
+[Pull model](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:pullModel
+
+
+### Create a new Image
+
+In order to create a new image that contains the model, you can use the following code:
+
+
+[Commit Image](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:commitToImage
+
+
+And use the new image along with [Image name Substitution](../features/image_name_substitution.md#manual-substitution)
+
+
+[Use new Image](../../modules/ollama/src/test/java/org/testcontainers/ollama/OllamaContainerTest.java) inside_block:substitute
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-ollama:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-ollama
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/openfga.md b/docs/modules/openfga.md
new file mode 100644
index 00000000000..4d916ce6aa6
--- /dev/null
+++ b/docs/modules/openfga.md
@@ -0,0 +1,30 @@
+# OpenFGA
+
+Testcontainers module for [OpenFGA](https://hub.docker.com/r/openfga/openfga).
+
+## OpenFGAContainer's usage examples
+
+You can start an OpenFGA container instance from any Java application by using:
+
+
+[OpenFGA container](../../modules/openfga/src/test/java/org/testcontainers/openfga/OpenFGAContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-openfga:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-openfga
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/pinecone.md b/docs/modules/pinecone.md
new file mode 100644
index 00000000000..6bcea81ab39
--- /dev/null
+++ b/docs/modules/pinecone.md
@@ -0,0 +1,30 @@
+# Pinecone
+
+Testcontainers module for [Pinecone Local](https://github.com/orgs/pinecone-io/packages/container/package/pinecone-local).
+
+## PineconeLocalContainer's usage examples
+
+You can start a Pinecone container instance from any Java application by using:
+
+
+[Pinecone container](../../modules/pinecone/src/test/java/org/testcontainers/pinecone/PineconeLocalContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-pinecone:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+ org.testcontainers
+ testcontainers-pinecone
+ {{latest_version}}
+ test
+
+```
diff --git a/docs/modules/pulsar.md b/docs/modules/pulsar.md
index f74c315cbdc..5bd33b0bc4c 100644
--- a/docs/modules/pulsar.md
+++ b/docs/modules/pulsar.md
@@ -9,13 +9,13 @@ It's based on the official Apache Pulsar docker image, it is recommended to read
Create a `PulsarContainer` to use it in your tests:
-[Create a Pulsar container](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithVersion
+[Create a Pulsar container](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithVersion
Then you can retrieve the broker and the admin url:
-[Get broker and admin urls](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:coordinates
+[Get broker and admin urls](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:coordinates
## Options
@@ -26,7 +26,7 @@ If you need to set Pulsar configuration variables you can use the native APIs an
For example, if you want to enable `brokerDeduplicationEnabled`:
-[Set configuration variables](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithEnv
+[Set configuration variables](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithEnv
### Pulsar IO
@@ -34,7 +34,7 @@ For example, if you want to enable `brokerDeduplicationEnabled`:
If you need to test Pulsar IO framework you can enable the Pulsar Functions Worker:
-[Create a Pulsar container with functions worker](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithFunctionsWorker
+[Create a Pulsar container with functions worker](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithFunctionsWorker
### Pulsar Transactions
@@ -42,7 +42,7 @@ If you need to test Pulsar IO framework you can enable the Pulsar Functions Work
If you need to test Pulsar Transactions you can enable the transactions feature:
-[Create a Pulsar container with transactions](../../modules/pulsar/src/test/java/org/testcontainers/containers/PulsarContainerTest.java) inside_block:constructorWithTransactions
+[Create a Pulsar container with transactions](../../modules/pulsar/src/test/java/org/testcontainers/pulsar/PulsarContainerTest.java) inside_block:constructorWithTransactions
@@ -52,13 +52,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:pulsar:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-pulsar:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- pulsar
+ testcontainers-pulsar{{latest_version}}test
diff --git a/docs/modules/qdrant.md b/docs/modules/qdrant.md
new file mode 100644
index 00000000000..9431a340a9c
--- /dev/null
+++ b/docs/modules/qdrant.md
@@ -0,0 +1,30 @@
+# Qdrant
+
+Testcontainers module for [Qdrant](https://registry.hub.docker.com/r/qdrant/qdrant)
+
+## Qdrant's usage examples
+
+You can start a Qdrant container instance from any Java application by using:
+
+
+[Default QDrant container](../../modules/qdrant/src/test/java/org/testcontainers/qdrant/QdrantContainerTest.java) inside_block:qdrantContainer
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-qdrant:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-qdrant
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/rabbitmq.md b/docs/modules/rabbitmq.md
index 8a9ae9d9b97..5381e3cd910 100644
--- a/docs/modules/rabbitmq.md
+++ b/docs/modules/rabbitmq.md
@@ -1,21 +1,18 @@
# RabbitMQ Module
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:rabbitmq:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-rabbitmq:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- rabbitmq
+ testcontainers-rabbitmq{{latest_version}}test
diff --git a/docs/modules/redpanda.md b/docs/modules/redpanda.md
index 8cdcc1ee83d..429ae5a9768 100644
--- a/docs/modules/redpanda.md
+++ b/docs/modules/redpanda.md
@@ -1,10 +1,10 @@
# Redpanda
Testcontainers can be used to automatically instantiate and manage [Redpanda](https://redpanda.com/) containers.
-More precisely Testcontainers uses the official Docker images for [Redpanda](https://hub.docker.com/r/vectorized/redpanda/)
+More precisely Testcontainers uses the official Docker images for [Redpanda](https://hub.docker.com/r/redpandadata/redpanda)
!!! note
- This module uses features provided in `docker.redpanda.com/vectorized/redpanda`.
+ This module uses features provided in `docker.redpanda.com/redpandadata/redpanda`.
## Example
@@ -25,19 +25,77 @@ Redpanda also provides a schema registry implementation. Like the Redpanda broke
[Schema Registry](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:getSchemaRegistryAddress
+It is also possible to enable security capabilities of Redpanda by using:
+
+
+[Enable security](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:security
+
+
+Superusers can be created by using:
+
+
+[Register Superuser](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:createSuperUser
+
+
+Below is an example of how to create the `AdminClient`:
+
+
+[Create Admin Client](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:createAdminClient
+
+
+There are scenarios where additional listeners are needed because the consumer/producer can be another
+container in the same network or a different process where the port to connect differs from the default
+exposed port `9092`. E.g [Toxiproxy](../modules/toxiproxy.md).
+
+
+[Register additional listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:registerListener
+
+
+Container defined in the same network:
+
+
+[Create kcat container](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:createKCatContainer
+
+
+Client using the new registered listener:
+
+
+[Produce/Consume via new listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:produceConsumeMessage
+
+
+The following examples shows how to register a proxy as a new listener in `RedpandaContainer`:
+
+Use `SocatContainer` to create the proxy
+
+
+[Create Proxy](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:createProxy
+
+
+Register the listener and advertised listener
+
+
+[Register Listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:registerListenerAndAdvertisedListener
+
+
+Client using the new registered listener:
+
+
+[Produce/Consume via new listener](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:produceConsumeMessageFromProxy
+
+
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
-testImplementation "org.testcontainers:redpanda:{{latest_version}}"
+testImplementation "org.testcontainers:testcontainers-redpanda:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- redpanda
+ testcontainers-redpanda{{latest_version}}test
diff --git a/docs/modules/solace.md b/docs/modules/solace.md
new file mode 100644
index 00000000000..91956533906
--- /dev/null
+++ b/docs/modules/solace.md
@@ -0,0 +1,39 @@
+# Solace Container
+
+This module helps running [Solace PubSub+](https://solace.com/products/event-broker/software/) using Testcontainers.
+
+Note that it's based on the [official Docker image](https://hub.docker.com/r/solace/solace-pubsub-standard).
+
+## Usage example
+
+You can start a solace container instance from any Java application by using:
+
+
+[Solace container setup with simple authentication](../../modules/solace/src/test/java/org/testcontainers/solace/SolaceContainerSMFTest.java) inside_block:solaceContainerSetup
+
+
+
+[Solace container setup with SSL](../../modules/solace/src/test/java/org/testcontainers/solace/SolaceContainerSMFTest.java) inside_block:solaceContainerUsageSSL
+
+
+
+[Using a Solace container](../../modules/solace/src/test/java/org/testcontainers/solace/SolaceContainerAMQPTest.java) inside_block:solaceContainerUsage
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-solace:{{latest_version}}"
+ ```
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-solace
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/solr.md b/docs/modules/solr.md
index 44be46c1a1a..957615fcbf1 100644
--- a/docs/modules/solr.md
+++ b/docs/modules/solr.md
@@ -1,10 +1,6 @@
# Solr Container
-!!! note
- This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy.
-
-
-This module helps running [solr](https://lucene.apache.org/solr/) using Testcontainers.
+This module helps running [solr](https://solr.apache.org/) using Testcontainers.
Note that it's based on the [official Docker image](https://hub.docker.com/_/solr/).
@@ -13,7 +9,7 @@ Note that it's based on the [official Docker image](https://hub.docker.com/_/sol
You can start a solr container instance from any Java application by using:
-[Using a Solr container](../../modules/solr/src/test/java/org/testcontainers/containers/SolrContainerTest.java) inside_block:solrContainerUsage
+[Using a Solr container](../../modules/solr/src/test/java/org/testcontainers/solr/SolrContainerTest.java) inside_block:solrContainerUsage
## Adding this module to your project dependencies
@@ -22,13 +18,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:solr:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-solr:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- solr
+ testcontainers-solr{{latest_version}}test
diff --git a/docs/modules/toxiproxy.md b/docs/modules/toxiproxy.md
index 1b8229982e6..40f792911bb 100644
--- a/docs/modules/toxiproxy.md
+++ b/docs/modules/toxiproxy.md
@@ -17,7 +17,7 @@ A Toxiproxy container can be placed in between test code and a container, or in
In either scenario, it is necessary to create a `ToxiproxyContainer` instance on the same Docker network, as follows:
-[Creating a Toxiproxy container](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:creatingProxy
+[Creating a Toxiproxy container](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:creatingProxy
Next, it is necessary to instruct Toxiproxy to start proxying connections.
@@ -26,13 +26,13 @@ Each `ToxiproxyContainer` can proxy to many target containers if necessary.
We do this as follows:
-[Starting proxying connections to a target container](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:obtainProxyObject
+[Starting proxying connections to a target container](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:obtainProxyObject
To establish a connection from the test code (on the host machine) to the target container via Toxiproxy, we obtain **Toxiproxy's** proxy host IP and port:
-[Obtaining proxied host and port](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:obtainProxiedHostAndPortForHostMachine
+[Obtaining proxied host and port](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:obtainProxiedHostAndPortForHostMachine
Code under test should connect to this proxied host IP and port.
@@ -56,13 +56,13 @@ Please see the [Toxiproxy documentation](https://github.com/Shopify/toxiproxy#to
As one example, we can introduce latency and random jitter to proxied connections as follows:
-[Adding latency to a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:addingLatency
+[Adding latency to a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:addingLatency
Additionally we can disable the proxy to simulate a complete interruption to the network connection:
-[Cutting a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/containers/ToxiproxyTest.java) inside_block:disableProxy
+[Cutting a connection](../../modules/toxiproxy/src/test/java/org/testcontainers/toxiproxy/ToxiproxyContainerTest.java) inside_block:disableProxy
## Adding this module to your project dependencies
@@ -71,13 +71,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:toxiproxy:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-toxiproxy:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- toxiproxy
+ testcontainers-toxiproxy{{latest_version}}test
@@ -86,5 +86,3 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
## Acknowledgements
This module was inspired by a [hotels.com blog post](https://medium.com/hotels-com-technology/i-dont-know-about-resilience-testing-and-so-can-you-b3c59d80012d).
-
-[toxiproxy-java](https://github.com/trekawek/toxiproxy-java) is used to help control failure conditions.
diff --git a/docs/modules/typesense.md b/docs/modules/typesense.md
new file mode 100644
index 00000000000..c73a640d881
--- /dev/null
+++ b/docs/modules/typesense.md
@@ -0,0 +1,30 @@
+# Typesense
+
+Testcontainers module for [Typesense](https://hub.docker.com/r/typesense/typesense).
+
+## TypesenseContainer's usage examples
+
+You can start a Typesense container instance from any Java application by using:
+
+
+[Typesense container](../../modules/typesense/src/test/java/org/testcontainers/typesense/TypesenseContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+ ```groovy
+ testImplementation "org.testcontainers:testcontainers-typesense:{{latest_version}}"
+ ```
+
+=== "Maven"
+ ```xml
+
+ org.testcontainers
+ testcontainers-typesense
+ {{latest_version}}
+ test
+
+ ```
diff --git a/docs/modules/vault.md b/docs/modules/vault.md
index e32abfd1c60..161efa8ccb0 100644
--- a/docs/modules/vault.md
+++ b/docs/modules/vault.md
@@ -4,7 +4,7 @@ Testcontainers module for [Vault](https://github.com/hashicorp/vault). Vault is
## Usage example
-Start Vault container as a `@ClassRule`:
+You can start a Vault container instance from any Java application by using:
[Starting a Vault container](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:vaultContainer
@@ -22,34 +22,19 @@ Use Http API to read data from Vault container:
[Use Http API to read data](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:readFirstSecretPathOverHttpApi
-Use client library to read data from Vault container:
-
-
-[Use library to read data](../../modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java) inside_block:readWithLibrary
-
-
-[See full example.](https://github.com/testcontainers/testcontainers-java/blob/master/modules/vault/src/test/java/org/testcontainers/vault/VaultContainerTest.java)
-
-## Why Vault in Junit tests?
-
-With the increasing popularity of Vault and secret management, applications are now needing to source secrets from Vault.
-This can prove challenging in the development phase without a running Vault instance readily on hand. This library
-aims to solve your apps integration testing with Vault. You can also use it to
-test how your application behaves with Vault by writing different test scenarios in Junit.
-
## Adding this module to your project dependencies
Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:vault:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-vault:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- vault
+ testcontainers-vault{{latest_version}}test
diff --git a/docs/modules/weaviate.md b/docs/modules/weaviate.md
new file mode 100644
index 00000000000..76146ab5ee9
--- /dev/null
+++ b/docs/modules/weaviate.md
@@ -0,0 +1,30 @@
+# Weaviate
+
+Testcontainers module for [Weaviate](https://hub.docker.com/r/semitechnologies/weaviate)
+
+## WeaviateContainer's usage examples
+
+You can start a Weaviate container instance from any Java application by using:
+
+
+[Default Weaviate container](../../modules/weaviate/src/test/java/org/testcontainers/weaviate/WeaviateContainerTest.java) inside_block:container
+
+
+## Adding this module to your project dependencies
+
+Add the following dependency to your `pom.xml`/`build.gradle` file:
+
+=== "Gradle"
+```groovy
+testImplementation "org.testcontainers:testcontainers-weaviate:{{latest_version}}"
+```
+
+=== "Maven"
+```xml
+
+org.testcontainers
+testcontainers-weaviate
+{{latest_version}}
+test
+
+```
diff --git a/docs/modules/webdriver_containers.md b/docs/modules/webdriver_containers.md
index 65b39bc5a8f..8101f489e3a 100644
--- a/docs/modules/webdriver_containers.md
+++ b/docs/modules/webdriver_containers.md
@@ -23,14 +23,14 @@ every test.
The following field in your JUnit UI test class will prepare a container running Chrome:
-[Chrome](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java) inside_block:junitRule
+[Chrome](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java) inside_block:junitRule
Now, instead of instantiating an instance of WebDriver directly, use the following to obtain an instance inside your
test methods:
-[RemoteWebDriver](../../modules/selenium/src/test/java/org/testcontainers/junit/LocalServerWebDriverContainerTest.java) inside_block:getWebDriver
+[RemoteWebDriver](../../modules/selenium/src/test/java/org/testcontainers/selenium/LocalServerWebDriverContainerTest.java) inside_block:getWebDriver
You can then use this driver instance like a regular WebDriver.
@@ -38,7 +38,7 @@ You can then use this driver instance like a regular WebDriver.
Note that, if you want to test a **web application running on the host machine** (the machine the JUnit tests are
running on - which is quite likely), you'll need to use [the host exposing](../features/networking.md#exposing-host-ports-to-the-container) feature of Testcontainers, e.g.:
-[Open Web Page](../../modules/selenium/src/test/java/org/testcontainers/junit/LocalServerWebDriverContainerTest.java) inside_block:getPage
+[Open Web Page](../../modules/selenium/src/test/java/org/testcontainers/selenium/LocalServerWebDriverContainerTest.java) inside_block:getPage
@@ -48,9 +48,9 @@ running on - which is quite likely), you'll need to use [the host exposing](../f
At the moment, Chrome, Firefox and Edge are supported. To switch, simply change the first parameter to the rule constructor:
-[Chrome](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java) inside_block:junitRule
-[Firefox](../../modules/selenium/src/test/java/org/testcontainers/junit/FirefoxWebDriverContainerTest.java) inside_block:junitRule
-[Edge](../../modules/selenium/src/test/java/org/testcontainers/junit/EdgeWebDriverContainerTest.java) inside_block:junitRule
+[Chrome](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java) inside_block:junitRule
+[Firefox](../../modules/selenium/src/test/java/org/testcontainers/selenium/FirefoxWebDriverContainerTest.java) inside_block:junitRule
+[Edge](../../modules/selenium/src/test/java/org/testcontainers/selenium/EdgeWebDriverContainerTest.java) inside_block:junitRule
### Recording videos
@@ -59,8 +59,8 @@ By default, no videos will be recorded. However, you can instruct Testcontainers
just for failing tests.
-[Record all Tests](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordAll
-[Record failing Tests](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFailing
+[Record all Tests](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordAll
+[Record failing Tests](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFailing
Note that the second parameter of `withRecordingMode` should be a directory where recordings can be saved.
@@ -68,13 +68,13 @@ Note that the second parameter of `withRecordingMode` should be a directory wher
By default, the video will be recorded in [FLV](https://en.wikipedia.org/wiki/Flash_Video) format, but you can specify it explicitly or change it to [MP4](https://en.wikipedia.org/wiki/MPEG-4_Part_14) using `withRecordingMode` method with `VncRecordingFormat` option:
-[Video Format in MP4](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordMp4
-[Video Format in FLV](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFlv
+[Video Format in MP4](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordMp4
+[Video Format in FLV](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:recordFlv
If you would like to customise the file name of the recording, or provide a different directory at runtime based on the description of the test and/or its success or failure, you may provide a custom recording file factory as follows:
-[CustomRecordingFileFactory](../../modules/selenium/src/test/java/org/testcontainers/junit/ChromeRecordingWebDriverContainerTest.java) inside_block:withRecordingFileFactory
+[CustomRecordingFileFactory](../../modules/selenium/src/test/java/org/testcontainers/selenium/ChromeRecordingWebDriverContainerTest.java) inside_block:withRecordingFileFactory
@@ -82,7 +82,7 @@ Note the factory must implement `org.testcontainers.containers.RecordingFileFact
## More examples
-A few different examples are shown in [ChromeWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/main/modules/selenium/src/test/java/org/testcontainers/junit/ChromeWebDriverContainerTest.java).
+A few different examples are shown in [ChromeWebDriverContainerTest.java](https://github.com/testcontainers/testcontainers-java/blob/main/modules/selenium/src/test/java/org/testcontainers/selenium/ChromeWebDriverContainerTest.java).
## Adding this module to your project dependencies
@@ -90,13 +90,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:selenium:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-selenium:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- selenium
+ testcontainers-selenium{{latest_version}}test
diff --git a/docs/quickstart/junit_5_quickstart.md b/docs/quickstart/junit_5_quickstart.md
index 24e9dd71a74..effd17dd2d9 100644
--- a/docs/quickstart/junit_5_quickstart.md
+++ b/docs/quickstart/junit_5_quickstart.md
@@ -25,7 +25,7 @@ First, add Testcontainers as a dependency as follows:
```groovy
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:testcontainers:{{latest_version}}"
- testImplementation "org.testcontainers:junit-jupiter:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-junit-jupiter:{{latest_version}}"
```
=== "Maven"
```xml
@@ -43,7 +43,7 @@ First, add Testcontainers as a dependency as follows:
org.testcontainers
- junit-jupiter
+ testcontainers-junit-jupiter{{latest_version}}test
@@ -85,7 +85,16 @@ We can do this in our test `setUp` method, to set up our component under test:
not work on your current or future CI environment. As such, **avoid hard-coding** the address, and use
`getHost()` instead.
-## 4. Run the tests!
+## 4. Additional attributes
+
+Additional attributes are available for the `@Testcontainers` annotation.
+Those attributes can be helpful when:
+
+* Tests should be skipped instead of failing because Docker is unavailable in the
+current environment. Set `disabledWithoutDocker` to `true`.
+* Enable parallel container initialization instead of sequential (by default). Set `parallel` to `true`.
+
+## 5. Run the tests!
That's it!
diff --git a/docs/quickstart/spock_quickstart.md b/docs/quickstart/spock_quickstart.md
index 267954e99ee..c9c78bea5ea 100644
--- a/docs/quickstart/spock_quickstart.md
+++ b/docs/quickstart/spock_quickstart.md
@@ -23,13 +23,13 @@ First, add Testcontainers as a dependency as follows:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:spock:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-spock:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- spock
+ testcontainers-spock{{latest_version}}test
diff --git a/docs/supported_docker_environment/continuous_integration/circle_ci.md b/docs/supported_docker_environment/continuous_integration/circle_ci.md
index d6e85a62a79..936192cc799 100644
--- a/docs/supported_docker_environment/continuous_integration/circle_ci.md
+++ b/docs/supported_docker_environment/continuous_integration/circle_ci.md
@@ -1,7 +1,7 @@
# CircleCI (Cloud, Server v2.x, and Server v3.x)
Your CircleCI configuration should use a dedicated VM for Testcontainers to work. You can achieve this by specifying the
-executor type in your `.circleci/config.yml` to be `machine` instead of the default `docker` executor (see [Choosing an Executor Type](https://circleci.com/docs/2.0/executor-types/) for more info).
+executor type in your `.circleci/config.yml` to be `machine` instead of the default `docker` executor (see [Choosing an Executor Type](https://circleci.com/docs/executor-intro) for more info).
Here is a sample CircleCI configuration that does a checkout of a project and runs Maven:
diff --git a/docs/supported_docker_environment/continuous_integration/gitlab_ci.md b/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
index f2226f2d34f..ccc73f58078 100644
--- a/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
+++ b/docs/supported_docker_environment/continuous_integration/gitlab_ci.md
@@ -24,10 +24,10 @@ See below for an example runner configuration:
Please also include the following in your GitlabCI pipeline definitions (`.gitlab-ci.yml`) that use Testcontainers:
```yml
variables:
- TESTCONTAINERS_HOST_OVERRIDE: "host.docker.internal"
+ TESTCONTAINERS_HOST_OVERRIDE: ""
```
-The environment variable `TESTCONTAINERS_HOST_OVERRIDE` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests.
+The environment variable `TESTCONTAINERS_HOST_OVERRIDE` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests. For Windows and MacOS, use `host.docker.internal`.
## Example using DinD (Docker-in-Docker)
@@ -46,7 +46,7 @@ services:
command: ["--tls=false"]
variables:
- # Instruct Testcontainers to use the daemon of DinD, use port 2735 for non-tls connections.
+ # Instruct Testcontainers to use the daemon of DinD, use port 2375 for non-tls connections.
DOCKER_HOST: "tcp://docker:2375"
# Instruct Docker not to start over TLS.
DOCKER_TLS_CERTDIR: ""
diff --git a/docs/supported_docker_environment/index.md b/docs/supported_docker_environment/index.md
index 66a0932e0bd..0bdac109245 100644
--- a/docs/supported_docker_environment/index.md
+++ b/docs/supported_docker_environment/index.md
@@ -1,34 +1,90 @@
-# General Docker requirements
+# General Container runtime requirements
## Overview
-Testcontainers requires a Docker-API compatible container runtime.
-During development, Testcontainers is actively tested against recent versions of Docker on Linux, as well as against Docker Desktop on Mac and Windows.
+To run Testcontainers-based tests,
+you need a Docker-API compatible container runtime,
+such as using [Testcontainers Cloud](https://www.testcontainers.cloud/) or installing Docker locally.
+During development, Testcontainers is actively tested against recent versions of Docker on Linux,
+as well as against Docker Desktop on Mac and Windows.
These Docker environments are automatically detected and used by Testcontainers without any additional configuration being necessary.
-It is possible to configure Testcontainers to work for other Docker setups, such as a remote Docker host or Docker alternatives.
-However, these are not actively tested in the main development workflow, so not all Testcontainers features might be available and additional manual configuration might be necessary.
-If you have further questions about configuration details for your setup or whether it supports running Testcontainers-based tests,
+It is possible to configure Testcontainers to work with alternative container runtimes.
+Making use of the free [Testcontainers Desktop](https://testcontainers.com/desktop/) app will take care of most of the manual configuration.
+When using those alternatives without Testcontainers Desktop,
+sometimes some manual configuration might be necessary
+(see further down for specific runtimes, or [Customizing Docker host detection](/features/configuration/#customizing-docker-host-detection) for general configuration mechanisms).
+Alternative container runtimes are not actively tested in the main development workflow,
+so not all Testcontainers features might be available.
+If you have further questions about configuration details for your setup or whether it supports running Testcontainers-based tests,
please contact the Testcontainers team and other users from the Testcontainers community on [Slack](https://slack.testcontainers.org/).
-| Host Operating System / Environment | Minimum recommended docker versions | Known issues / tips |
-|-------------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| Linux - general | Docker v17.09 | After docker installation, follow [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/). |
-| Linux - CircleCI (LXC driver) | Docker v17.09 | The `exec` feature is not compatible with CircleCI. See CircleCI configuration [example](./continuous_integration/circle_ci.md) |
-| Linux - within a Docker container | Docker v17.09 | See [Running inside Docker](continuous_integration/dind_patterns.md) for Docker-in-Docker and Docker wormhole patterns |
-| Mac OS X - Docker Toolbox | Docker Machine v0.8.0 | |
-| Mac OS X - Docker for Mac | v17.09 | Starting 4.13, run `sudo ln -s $HOME/.docker/run/docker.sock /var/run/docker.sock` Support is best-efforts at present `getTestHostIpAddress()` is [not currently supported](https://github.com/testcontainers/testcontainers-java/issues/166) due to limitations in Docker for Mac. |
-| Windows - Docker Toolbox | | *Support is limited at present and this is not currently tested on a regular basis*. |
-| Windows - Docker for Windows | | *Support is best-efforts at present.* Only Linux Containers (LCOW) are supported at the moment. See [Windows Support](windows.md) |
-| Windows - Windows Subsystem for Linux (WSL) | Docker v17.09 | *Support is best-efforts at present.* Only Linux Containers (LCOW) are supported at the moment. See [Windows Support](windows.md). |
+## Colima
-## Using Colima?
+In order to run testcontainers against [colima](https://github.com/abiosoft/colima) the env vars below should be set
-In order to run testcontainers against [colima](https://github.com/abiosoft/colima) the env vars bellow should be set
+```bash
+colima start --network-address
+export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
+export TESTCONTAINERS_HOST_OVERRIDE=$(colima ls -j | jq -r '.address')
+export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"
+```
+
+## Podman
+
+In order to run testcontainers against [podman](https://podman.io/) the env vars bellow should be set
+
+MacOS:
+
+```bash
+{% raw %}
+export DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')
+export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
+{% endraw %}
+```
+
+Linux:
+
+```bash
+export DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock
+```
+
+If you're running Podman in rootless mode, ensure to include the following line to disable Ryuk:
+
+```bash
+export TESTCONTAINERS_RYUK_DISABLED=true
+```
+
+!!! note
+ Previous to version 1.19.0, `export TESTCONTAINERS_RYUK_PRIVILEGED=true`
+ was required for rootful mode. Starting with 1.19.0, this is no longer required.
+
+## Rancher Desktop
+
+In order to run testcontainers against [Rancher Desktop](https://rancherdesktop.io/) the env vars below should be set.
+
+If you're running Rancher Desktop as an administrator in a MacOS (M1) machine:
+
+Using QEMU emulation
+
+```bash
+export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show rd0 | awk '/inet / {sub("/.*",""); print $2}')
+```
+
+Using VZ emulation
```bash
+export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')
+```
+
+If you're not running Rancher Desktop as an administrator in a MacOS (M1) machine:
+
+Using VZ emulation
+
+```bash
+export DOCKER_HOST=unix://$HOME/.rd/docker.sock
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
-export DOCKER_HOST="unix://${HOME}/.colima/docker.sock"
+export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')
```
## Docker environment discovery
@@ -45,3 +101,12 @@ Testcontainers will try to connect to a Docker daemon using the following strate
* `DOCKER_CERT_PATH=~/.docker`
* If Docker Machine is installed, the docker machine environment for the *first* machine found. Docker Machine needs to be on the PATH for this to succeed.
* If you're going to run your tests inside a container, please read [Patterns for running tests inside a docker container](continuous_integration/dind_patterns.md) first.
+
+## Docker registry authentication
+
+Testcontainers will try to authenticate to registries with supplied config using the following strategies in order:
+
+* Environment variables:
+ * `DOCKER_AUTH_CONFIG`
+* Docker config
+ * At location specified in `DOCKER_CONFIG` or at `{HOME}/.docker/config.json`
diff --git a/docs/supported_docker_environment/logging_config.md b/docs/supported_docker_environment/logging_config.md
index 3e4660e85ae..6bbe0584434 100644
--- a/docs/supported_docker_environment/logging_config.md
+++ b/docs/supported_docker_environment/logging_config.md
@@ -17,6 +17,8 @@ should be included in your classpath to show a reasonable level of log output:
+
+
diff --git a/docs/test_framework_integration/external.md b/docs/test_framework_integration/external.md
new file mode 100644
index 00000000000..3396ff15d52
--- /dev/null
+++ b/docs/test_framework_integration/external.md
@@ -0,0 +1,10 @@
+# External Integrations
+
+The following Open Source frameworks add direct integration to Testcontainers
+
+| Framework | Source Code | Documentation |
+| --- | --- | --- |
+| jqwik | [jqwik-testcontainers](https://github.com/jqwik-team/jqwik-testcontainers) | [README](https://github.com/jqwik-team/jqwik-testcontainers) |
+| Kotest | [Kotest Extensions Testcontainers](https://github.com/kotest/kotest/tree/master/kotest-extensions/kotest-extensions-testcontainers) | [kotest.io](https://kotest.io/docs/extensions/test_containers.html) |
+| Synthesized | [Synthesized TDK-Testcontainers integration](https://github.com/synthesized-io/tdk-tc) | [synthesized.io](https://docs.synthesized.io/tdk/latest/user_guide/integrations/testcontainers) |
+| TCI | [Testcontainers Infrastructure (TCI) Framework](https://github.com/xdev-software/tci-base) | [README](https://github.com/xdev-software/tci-base) |
diff --git a/docs/test_framework_integration/junit_5.md b/docs/test_framework_integration/junit_5.md
index 15597f90cdb..aed2d515af9 100644
--- a/docs/test_framework_integration/junit_5.md
+++ b/docs/test_framework_integration/junit_5.md
@@ -1,7 +1,6 @@
# Jupiter / JUnit 5
-While Testcontainers is tightly coupled with the JUnit 4.x rule API, this module provides
-an API that is based on the [JUnit Jupiter](https://junit.org/junit5/) extension model.
+This module provides an API that is based on the [JUnit Jupiter](https://junit.org/junit5/) extension model.
The extension supports two modes:
@@ -58,11 +57,7 @@ using JUnit 5.
## Limitations
-Since this module has a dependency onto JUnit Jupiter and on Testcontainers core, which
-has a dependency onto JUnit 4.x, projects using this module will end up with both, JUnit Jupiter
-and JUnit 4.x in the test classpath.
-
-This extension has only be tested with sequential test execution. Using it with parallel test execution is unsupported and may have unintended side effects.
+This extension has only been tested with sequential test execution. Using it with parallel test execution is unsupported and may have unintended side effects.
## Adding Testcontainers JUnit 5 support to your project dependencies
@@ -70,13 +65,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:junit-jupiter:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-junit-jupiter:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- junit-jupiter
+ testcontainers-junit-jupiter{{latest_version}}test
diff --git a/docs/test_framework_integration/manual_lifecycle_control.md b/docs/test_framework_integration/manual_lifecycle_control.md
index 6de3cb47196..e1005397c00 100644
--- a/docs/test_framework_integration/manual_lifecycle_control.md
+++ b/docs/test_framework_integration/manual_lifecycle_control.md
@@ -1,7 +1,6 @@
# Manual container lifecycle control
-While Testcontainers was originally built with JUnit 4 integration in mind, it is fully usable with other test
-frameworks, or with no framework at all.
+Testcontainers is fully usable with any test framework, or with no framework at all.
## Manually starting/stopping containers
diff --git a/docs/test_framework_integration/spock.md b/docs/test_framework_integration/spock.md
index b8c1d5b7eae..3d50e0399d2 100644
--- a/docs/test_framework_integration/spock.md
+++ b/docs/test_framework_integration/spock.md
@@ -19,13 +19,13 @@ Add the following dependency to your `pom.xml`/`build.gradle` file:
=== "Gradle"
```groovy
- testImplementation "org.testcontainers:spock:{{latest_version}}"
+ testImplementation "org.testcontainers:testcontainers-spock:{{latest_version}}"
```
=== "Maven"
```xml
org.testcontainers
- spock
+ testcontainers-spock{{latest_version}}test
diff --git a/docs/testcontainers-logo.svg b/docs/testcontainers-logo.svg
new file mode 100644
index 00000000000..4b099f34a8e
--- /dev/null
+++ b/docs/testcontainers-logo.svg
@@ -0,0 +1,22 @@
+
+
\ No newline at end of file
diff --git a/docs/theme/main.html b/docs/theme/main.html
index f96a2669e7e..b3c01a3a271 100644
--- a/docs/theme/main.html
+++ b/docs/theme/main.html
@@ -2,4 +2,9 @@
{% block analytics %}
+{% endblock %}
+
+{% block extrahead %}
+
+
{% endblock %}
\ No newline at end of file
diff --git a/docs/theme/partials/header.html b/docs/theme/partials/header.html
new file mode 100644
index 00000000000..057ec4ae5e0
--- /dev/null
+++ b/docs/theme/partials/header.html
@@ -0,0 +1,150 @@
+
+
+
+{% set class = "md-header" %}
+{% if "navigation.tabs.sticky" in features %}
+ {% set class = class ~ " md-header--shadow md-header--lifted" %}
+{% elif "navigation.tabs" not in features %}
+ {% set class = class ~ " md-header--shadow" %}
+{% endif %}
+
+{% include "partials/tc-header.html" %}
+
+
+
+
+
+
+ {% if "navigation.tabs.sticky" in features %}
+ {% if "navigation.tabs" in features %}
+ {% include "partials/tabs.html" %}
+ {% endif %}
+ {% endif %}
+
\ No newline at end of file
diff --git a/docs/theme/partials/nav.html b/docs/theme/partials/nav.html
new file mode 100644
index 00000000000..acf6c9565ea
--- /dev/null
+++ b/docs/theme/partials/nav.html
@@ -0,0 +1,79 @@
+
+
+
+{% set class = "md-nav md-nav--primary" %}
+{% if "navigation.tabs" in features %}
+{% set class = class ~ " md-nav--lifted" %}
+{% endif %}
+{% if "toc.integrate" in features %}
+{% set class = class ~ " md-nav--integrated" %}
+{% endif %}
+
+
+
\ No newline at end of file
diff --git a/docs/theme/partials/tc-header.html b/docs/theme/partials/tc-header.html
new file mode 100644
index 00000000000..246e9ff523a
--- /dev/null
+++ b/docs/theme/partials/tc-header.html
@@ -0,0 +1,157 @@
+{% set header = ({
+ "siteUrl": "https://testcontainers.com/",
+ "menuItems": [
+ {
+ "label": "Desktop NEW",
+ "url": "https://testcontainers.com/desktop/"
+ },
+ {
+ "label": "Cloud",
+ "url": "https://testcontainers.com/cloud/"
+ },
+ {
+ "label": "Getting Started",
+ "url": "https://testcontainers.com/getting-started/"
+ },
+ {
+ "label": "Guides",
+ "url": "https://testcontainers.com/guides/"
+ },
+ {
+ "label": "Modules",
+ "url": "https://testcontainers.com/modules/"
+ },
+ {
+ "label": "Docs",
+ "children": [
+ {
+ "label": "Testcontainers for Java",
+ "url": "https://java.testcontainers.org/",
+ "image": "/language-logos/java.svg",
+ },
+ {
+ "label": "Testcontainers for Go",
+ "url": "https://golang.testcontainers.org/",
+ "image": "/language-logos/go.svg",
+ },
+ {
+ "label": "Testcontainers for .NET",
+ "url": "https://dotnet.testcontainers.org/",
+ "image": "/language-logos/dotnet.svg",
+ },
+ {
+ "label": "Testcontainers for Node.js",
+ "url": "https://node.testcontainers.org/",
+ "image": "/language-logos/nodejs.svg",
+ },
+ {
+ "label": "Testcontainers for Python",
+ "url": "https://testcontainers-python.readthedocs.io/en/latest/",
+ "image": "/language-logos/python.svg",
+ "external": true,
+ },
+ {
+ "label": "Testcontainers for Rust",
+ "url": "https://docs.rs/testcontainers/latest/testcontainers/",
+ "image": "/language-logos/rust.svg",
+ "external": true,
+ },
+ {
+ "label": "Testcontainers for Haskell",
+ "url": "https://github.com/testcontainers/testcontainers-hs",
+ "image": "/language-logos/haskell.svg",
+ "external": true,
+ },
+ {
+ "label": "Testcontainers for Ruby",
+ "url": "https://github.com/testcontainers/testcontainers-ruby",
+ "image": "/language-logos/ruby.svg",
+ "external": true,
+ },
+ ]
+ },
+ {
+ "label": "Slack",
+ "url": "https://slack.testcontainers.org/",
+ "icon": "icon-slack",
+ },
+ {
+ "label": "GitHub",
+ "url": "https://github.com/testcontainers",
+ "icon": "icon-github",
+ },
+ ]
+}) %}
+
+
+
+ * Exposed ports: 9042
+ */
+public class CassandraContainer extends GenericContainer {
+
+ private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("cassandra");
+
+ private static final Integer CQL_PORT = 9042;
+
+ private static final String DEFAULT_LOCAL_DATACENTER = "datacenter1";
+
+ private static final String DEFAULT_INIT_SCRIPT_FILENAME = "init.cql";
+
+ private static final String CONTAINER_CONFIG_LOCATION = "/etc/cassandra";
+
+ private static final String USERNAME = "cassandra";
+
+ private static final String PASSWORD = "cassandra";
+
+ private String configLocation;
+
+ private String initScriptPath;
+
+ private String clientCertFile;
+
+ private String clientKeyFile;
+
+ public CassandraContainer(String dockerImageName) {
+ this(DockerImageName.parse(dockerImageName));
+ }
+
+ public CassandraContainer(DockerImageName dockerImageName) {
+ super(dockerImageName);
+ dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
+
+ addExposedPort(CQL_PORT);
+
+ withEnv("CASSANDRA_SNITCH", "GossipingPropertyFileSnitch");
+ withEnv("JVM_OPTS", "-Dcassandra.skip_wait_for_gossip_to_settle=0 -Dcassandra.initial_token=0");
+ withEnv("HEAP_NEWSIZE", "128M");
+ withEnv("MAX_HEAP_SIZE", "1024M");
+ withEnv("CASSANDRA_ENDPOINT_SNITCH", "GossipingPropertyFileSnitch");
+ withEnv("CASSANDRA_DC", DEFAULT_LOCAL_DATACENTER);
+
+ // Use the CassandraQueryWaitStrategy by default to avoid potential issues when the authentication is enabled.
+ waitingFor(new CassandraQueryWaitStrategy());
+ }
+
+ @Override
+ protected void configure() {
+ // Map (effectively replace) directory in Docker with the content of resourceLocation if resource location is
+ // not null.
+ Optional
+ .ofNullable(configLocation)
+ .map(MountableFile::forClasspathResource)
+ .ifPresent(mountableFile -> withCopyFileToContainer(mountableFile, CONTAINER_CONFIG_LOCATION));
+
+ // If a secure connection is required by Cassandra configuration, copy the user certificate and key to a
+ // dedicated location and define a cqlshrc file with the appropriate SSL configuration.
+ // See: https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureCqlshSSL.html
+ if (isSslRequired()) {
+ withCopyFileToContainer(MountableFile.forClasspathResource(clientCertFile), "ssl/user_cert.pem");
+ withCopyFileToContainer(MountableFile.forClasspathResource(clientKeyFile), "ssl/user_key.pem");
+ withCopyFileToContainer(MountableFile.forClasspathResource("cqlshrc"), "/root/.cassandra/cqlshrc");
+ }
+ }
+
+ @Override
+ protected void containerIsStarted(InspectContainerResponse containerInfo) {
+ runInitScriptIfRequired();
+ }
+
+ /**
+ * Load init script content and apply it to the database if initScriptPath is set
+ */
+ private void runInitScriptIfRequired() {
+ if (this.initScriptPath != null) {
+ try {
+ final MountableFile originalInitScript = MountableFile.forClasspathResource(this.initScriptPath);
+ // The init script is executed as is by the cqlsh command, so copy it into the container. The name
+ // of the script is generic since it's not important to keep the original name.
+ copyFileToContainer(originalInitScript, DEFAULT_INIT_SCRIPT_FILENAME);
+ new CassandraDatabaseDelegate(this).execute(null, DEFAULT_INIT_SCRIPT_FILENAME, -1, false, false);
+ } catch (IllegalArgumentException e) {
+ // MountableFile.forClasspathResource will throw an IllegalArgumentException if the resource cannot
+ // be found.
+ logger().warn("Could not load classpath init script: {}", this.initScriptPath);
+ throw new ScriptLoadException(
+ "Could not load classpath init script: " + this.initScriptPath + ". Resource not found.",
+ e
+ );
+ } catch (ScriptUtils.ScriptStatementFailedException e) {
+ logger().error("Error while executing init script: {}", this.initScriptPath, e);
+ throw new ScriptUtils.UncategorizedScriptException(
+ "Error while executing init script: " + this.initScriptPath,
+ e
+ );
+ }
+ }
+ }
+
+ /**
+ * Initialize Cassandra with the custom overridden Cassandra configuration
+ *
+ * Be aware, that Docker effectively replaces all /etc/cassandra content with the content of config location, so if
+ * Cassandra.yaml in configLocation is absent or corrupted, then Cassandra just won't launch.
+ *
+ * @param configLocation relative classpath with the directory that contains cassandra.yaml and other configuration
+ * files
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withConfigurationOverride(String configLocation) {
+ this.configLocation = configLocation;
+ return self();
+ }
+
+ /**
+ * Initialize Cassandra with init CQL script
+ *
+ * CQL script will be applied after container is started (see using WaitStrategy).
+ *
+ *
+ * @param initScriptPath relative classpath resource
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withInitScript(String initScriptPath) {
+ this.initScriptPath = initScriptPath;
+ return self();
+ }
+
+ /**
+ * Configure secured connection (TLS) when required by the Cassandra configuration
+ * (i.e. cassandra.yaml file contains the property {@code client_encryption_options.optional} with value
+ * {@code false}).
+ *
+ * @param clientCertFile The client certificate required to execute CQL scripts.
+ * @param clientKeyFile The client key required to execute CQL scripts.
+ * @return The updated {@link CassandraContainer}.
+ */
+ public CassandraContainer withSsl(String clientCertFile, String clientKeyFile) {
+ this.clientCertFile = clientCertFile;
+ this.clientKeyFile = clientKeyFile;
+ return self();
+ }
+
+ /**
+ * @return Whether a secure connection is required between the client and the Cassandra server.
+ */
+ boolean isSslRequired() {
+ return StringUtils.isNoneBlank(this.clientCertFile, this.clientKeyFile);
+ }
+
+ /**
+ * Get username
+ *
+ * By default, Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml
+ * If username and password need to be used, then authenticator should be set as PasswordAuthenticator
+ * (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials
+ * user management should be modified
+ */
+ public String getUsername() {
+ return USERNAME;
+ }
+
+ /**
+ * Get password
+ *
+ * By default, Cassandra has authenticator: AllowAllAuthenticator in cassandra.yaml
+ * If username and password need to be used, then authenticator should be set as PasswordAuthenticator
+ * (through custom Cassandra configuration) and through CQL with default cassandra-cassandra credentials
+ * user management should be modified
+ */
+ public String getPassword() {
+ return PASSWORD;
+ }
+
+ /**
+ * Retrieve an {@link InetSocketAddress} for connecting to the Cassandra container via the driver.
+ *
+ * @return A InetSocketAddress representation of this Cassandra container's host and port.
+ */
+ public InetSocketAddress getContactPoint() {
+ return new InetSocketAddress(getHost(), getMappedPort(CQL_PORT));
+ }
+
+ /**
+ * Retrieve the Local Datacenter for connecting to the Cassandra container via the driver.
+ *
+ * @return The configured local Datacenter name.
+ */
+ public String getLocalDatacenter() {
+ return getEnvMap().getOrDefault("CASSANDRA_DC", DEFAULT_LOCAL_DATACENTER);
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java
new file mode 100644
index 00000000000..4867b8423e9
--- /dev/null
+++ b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraDatabaseDelegate.java
@@ -0,0 +1,98 @@
+package org.testcontainers.cassandra;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.ContainerState;
+import org.testcontainers.containers.ExecConfig;
+import org.testcontainers.delegate.AbstractDatabaseDelegate;
+import org.testcontainers.ext.ScriptUtils.ScriptStatementFailedException;
+
+import java.io.IOException;
+
+/**
+ * Cassandra database delegate
+ */
+@Slf4j
+@RequiredArgsConstructor
+public class CassandraDatabaseDelegate extends AbstractDatabaseDelegate {
+
+ private final ContainerState container;
+
+ @Override
+ protected Void createNewConnection() {
+ // Return null here, because we run scripts using cqlsh command directly in the container.
+ // So, we don't use connection object in the execute() method.
+ return null;
+ }
+
+ public void execute(
+ String statement,
+ String scriptPath,
+ int lineNumber,
+ boolean continueOnError,
+ boolean ignoreFailedDrops,
+ boolean silentErrorLogs
+ ) {
+ try {
+ // Use cqlsh command directly inside the container to execute statements
+ // See documentation here: https://cassandra.apache.org/doc/stable/cassandra/tools/cqlsh.html
+ String[] cqlshCommand = new String[] { "cqlsh" };
+
+ if (this.container instanceof CassandraContainer) {
+ CassandraContainer cassandraContainer = (CassandraContainer) this.container;
+ String username = cassandraContainer.getUsername();
+ String password = cassandraContainer.getPassword();
+ if (cassandraContainer.isSslRequired()) {
+ cqlshCommand = ArrayUtils.add(cqlshCommand, "--ssl");
+ }
+ cqlshCommand = ArrayUtils.addAll(cqlshCommand, "-u", username, "-p", password);
+ }
+
+ // If no statement specified, directly execute the script specified into scriptPath (using -f argument),
+ // otherwise execute the given statement (using -e argument).
+ String executeArg = "-e";
+ String executeArgValue = statement;
+ if (StringUtils.isBlank(statement)) {
+ executeArg = "-f";
+ executeArgValue = scriptPath;
+ }
+ cqlshCommand = ArrayUtils.addAll(cqlshCommand, executeArg, executeArgValue);
+
+ Container.ExecResult result =
+ this.container.execInContainer(ExecConfig.builder().command(cqlshCommand).build());
+ if (result.getExitCode() == 0) {
+ if (StringUtils.isBlank(statement)) {
+ log.info("CQL script {} successfully executed", scriptPath);
+ } else {
+ log.info("CQL statement {} was applied", statement);
+ }
+ } else {
+ if (!silentErrorLogs) {
+ log.error("CQL script execution failed with error: \n{}", result.getStderr());
+ }
+ throw new ScriptStatementFailedException(statement, lineNumber, scriptPath);
+ }
+ } catch (IOException | InterruptedException e) {
+ throw new ScriptStatementFailedException(statement, lineNumber, scriptPath, e);
+ }
+ }
+
+ @Override
+ public void execute(
+ String statement,
+ String scriptPath,
+ int lineNumber,
+ boolean continueOnError,
+ boolean ignoreFailedDrops
+ ) {
+ this.execute(statement, scriptPath, lineNumber, continueOnError, ignoreFailedDrops, false);
+ }
+
+ @Override
+ protected void closeConnectionQuietly(Void session) {
+ // Nothing to do here, because we run scripts using cqlsh command directly in the container.
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java
new file mode 100644
index 00000000000..19fdcd7f9e1
--- /dev/null
+++ b/modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraQueryWaitStrategy.java
@@ -0,0 +1,57 @@
+package org.testcontainers.cassandra;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.rnorth.ducttape.TimeoutException;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy;
+import org.testcontainers.delegate.DatabaseDelegate;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess;
+
+/**
+ * Waits until Cassandra returns its version
+ */
+@Slf4j
+public class CassandraQueryWaitStrategy extends AbstractWaitStrategy {
+
+ private static final String SELECT_VERSION_QUERY = "SELECT release_version FROM system.local";
+
+ private static final String TIMEOUT_ERROR = "Timed out waiting for Cassandra to be accessible for query execution";
+
+ @Override
+ protected void waitUntilReady() {
+ // execute select version query until success or timeout
+ try {
+ retryUntilSuccess(
+ (int) startupTimeout.getSeconds(),
+ TimeUnit.SECONDS,
+ () -> {
+ getRateLimiter()
+ .doWhenReady(() -> {
+ try (DatabaseDelegate databaseDelegate = getDatabaseDelegate()) {
+ log.info("Checking connection is ready...");
+ ((CassandraDatabaseDelegate) databaseDelegate).execute(
+ SELECT_VERSION_QUERY,
+ StringUtils.EMPTY,
+ 1,
+ false,
+ false,
+ true
+ );
+ }
+ });
+ return true;
+ }
+ );
+ } catch (TimeoutException e) {
+ throw new ContainerLaunchException(TIMEOUT_ERROR);
+ }
+ }
+
+ private DatabaseDelegate getDatabaseDelegate() {
+ return new CassandraDatabaseDelegate(waitStrategyTarget);
+ }
+}
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java b/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
index a12ac03f18d..fcaada177ce 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/CassandraContainer.java
@@ -19,12 +19,15 @@
import javax.script.ScriptException;
/**
- * Cassandra container
+ * Testcontainers implementation for Apache Cassandra.
+ *
+ * Supported image: {@code cassandra}
+ *
+ * Exposed ports: 9042
*
- * Supports 2.x and 3.x Cassandra versions
- *
- * @author Eugeny Karpov
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraContainer} instead.
*/
+@Deprecated
public class CassandraContainer> extends GenericContainer {
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("cassandra");
@@ -225,7 +228,7 @@ public static Cluster getCluster(ContainerState containerState) {
/**
* Retrieve an {@link InetSocketAddress} for connecting to the Cassandra container via the driver.
*
- * @return A InetSocketAddrss representation of this Cassandra container's host and port.
+ * @return A InetSocketAddress representation of this Cassandra container's host and port.
*/
public InetSocketAddress getContactPoint() {
return new InetSocketAddress(getHost(), getMappedPort(CQL_PORT));
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java b/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
index 8bc72e7f154..7b7739490ea 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/delegate/CassandraDatabaseDelegate.java
@@ -14,10 +14,11 @@
/**
* Cassandra database delegate
*
- * @author Eugeny Karpov
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraDatabaseDelegate} instead.
*/
@Slf4j
@RequiredArgsConstructor
+@Deprecated
public class CassandraDatabaseDelegate extends AbstractDatabaseDelegate {
private final ContainerState container;
diff --git a/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java b/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
index aa2466cf7c4..9694711de6e 100644
--- a/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
+++ b/modules/cassandra/src/main/java/org/testcontainers/containers/wait/CassandraQueryWaitStrategy.java
@@ -13,8 +13,9 @@
/**
* Waits until Cassandra returns its version
*
- * @author Eugeny Karpov
+ * @deprecated use {@link org.testcontainers.cassandra.CassandraQueryWaitStrategy} instead.
*/
+@Deprecated
public class CassandraQueryWaitStrategy extends AbstractWaitStrategy {
private static final String SELECT_VERSION_QUERY = "SELECT release_version FROM system.local";
diff --git a/modules/cassandra/src/main/resources/cqlshrc b/modules/cassandra/src/main/resources/cqlshrc
new file mode 100644
index 00000000000..02e001098af
--- /dev/null
+++ b/modules/cassandra/src/main/resources/cqlshrc
@@ -0,0 +1,7 @@
+[ssl]
+certfile = ssl/user_cert.pem
+usercert = ssl/user_cert.pem
+userkey = ssl/user_key.pem
+
+[connection]
+factory = cqlshlib.ssl.ssl_transport_factory
\ No newline at end of file
diff --git a/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java
new file mode 100644
index 00000000000..49243317a40
--- /dev/null
+++ b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CassandraContainerTest.java
@@ -0,0 +1,272 @@
+package org.testcontainers.cassandra;
+
+import com.datastax.oss.driver.api.core.CqlSession;
+import com.datastax.oss.driver.api.core.CqlSessionBuilder;
+import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
+import com.datastax.oss.driver.api.core.config.DriverConfigLoader;
+import com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder;
+import com.datastax.oss.driver.api.core.context.DriverContext;
+import com.datastax.oss.driver.api.core.cql.ResultSet;
+import com.datastax.oss.driver.api.core.cql.Row;
+import com.datastax.oss.driver.api.core.session.ProgrammaticArguments;
+import com.datastax.oss.driver.internal.core.context.DefaultDriverContext;
+import com.datastax.oss.driver.internal.core.ssl.DefaultSslEngineFactory;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.ContainerLaunchException;
+import org.testcontainers.utility.DockerImageName;
+
+import java.net.URL;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+
+class CassandraContainerTest {
+
+ private static final String CASSANDRA_IMAGE = "cassandra:3.11.15";
+
+ private static final String TEST_CLUSTER_NAME_IN_CONF = "Test Cluster Integration Test";
+
+ private static final String BASIC_QUERY = "SELECT release_version FROM system.local";
+
+ @Test
+ void testSimple() {
+ try ( // container-definition {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ // }
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0)).as("Result set has release_version").isNotNull();
+ }
+ }
+
+ @Test
+ void testSpecificVersion() {
+ String cassandraVersion = "3.0.15";
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(
+ DockerImageName.parse("cassandra").withTag(cassandraVersion)
+ )
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0)).as("Cassandra has right version").isEqualTo(cassandraVersion);
+ }
+ }
+
+ @Test
+ void testConfigurationOverride() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-test-configuration-example")
+ ) {
+ cassandraContainer.start();
+ ResultSet resultSet = performQuery(cassandraContainer, "SELECT cluster_name FROM system.local");
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0))
+ .as("Cassandra configuration is overridden")
+ .isEqualTo(TEST_CLUSTER_NAME_IN_CONF);
+ }
+ }
+
+ @Test
+ public void testWithSslClientConfig() {
+ /*
+ Commands executed to generate certificates in 'cassandra-ssl-configuration' directory:
+ keytool -genkey -keyalg RSA -validity 36500 -alias localhost -keystore keystore.p12 -storepass cassandra \
+ -keypass cassandra -dname "CN=localhost, OU=Testcontainers, O=Testcontainers, L=None, C=None"
+ keytool -export -alias localhost -file cassandra.cer -keystore keystore.p12
+ keytool -import -v -trustcacerts -alias localhost -file cassandra.cer -keystore truststore.p12
+
+ Commands executed to generate the client certificate and key in 'client-ssl' directory:
+ keytool -importkeystore -srckeystore keystore.p12 -destkeystore test_node.p12 -deststoretype PKCS12 \
+ -srcstorepass cassandra -deststorepass cassandra
+ openssl pkcs12 -in test_node.p12 -nokeys -out cassandra.cer.pem -passin pass:cassandra
+ openssl pkcs12 -in test_node.p12 -nodes -nocerts -out cassandra.key.pem -passin pass:cassandra
+
+ Reference:
+ https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureSSLCertificates.html
+ https://docs.datastax.com/en/cassandra-oss/3.x/cassandra/configuration/secureCqlshSSL.html
+ */
+ try (
+ // with-ssl-config {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-ssl-configuration")
+ .withSsl("client-ssl/cassandra.cer.pem", "client-ssl/cassandra.key.pem")
+ // }
+ ) {
+ cassandraContainer.start();
+ try {
+ ResultSet resultSet = performQueryWithSslClientConfig(
+ cassandraContainer,
+ "SELECT cluster_name FROM system.local"
+ );
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ assertThat(resultSet.one().getString(0))
+ .as("Cassandra configuration is configured with secured connection")
+ .isEqualTo(TEST_CLUSTER_NAME_IN_CONF);
+ } catch (Exception e) {
+ fail(e);
+ }
+ }
+ }
+
+ @Test
+ public void testSimpleSslCqlsh() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-ssl-configuration")
+ .withSsl("client-ssl/cassandra.cer.pem", "client-ssl/cassandra.key.pem")
+ ) {
+ cassandraContainer.start();
+
+ Container.ExecResult execResult = cassandraContainer.execInContainer(
+ "cqlsh",
+ "--ssl",
+ "-e",
+ "SELECT * FROM system_schema.keyspaces;"
+ );
+ assertThat(execResult.getStdout()).contains("keyspace_name");
+ } catch (Exception e) {
+ fail(e);
+ }
+ }
+
+ @Test
+ void testEmptyConfigurationOverride() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-empty-configuration")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScript() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("initial.cql")
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, false);
+ }
+ }
+
+ @Test
+ void testNonexistentInitScript() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("unknown_script.cql")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScriptWithRequiredAuthentication() {
+ try (
+ // init-with-auth {
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withConfigurationOverride("cassandra-auth-required-configuration")
+ .withInitScript("initial.cql")
+ // }
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, true);
+ }
+ }
+
+ @Test
+ void testInitScriptWithError() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer(CASSANDRA_IMAGE)
+ .withInitScript("initial-with-error.cql")
+ ) {
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
+ }
+ }
+
+ @Test
+ void testInitScriptWithLegacyCassandra() {
+ try (
+ CassandraContainer cassandraContainer = new CassandraContainer("cassandra:2.2.11")
+ .withInitScript("initial.cql")
+ ) {
+ cassandraContainer.start();
+ testInitScript(cassandraContainer, false);
+ }
+ }
+
+ private void testInitScript(CassandraContainer cassandraContainer, boolean withCredentials) {
+ String query = "SELECT * FROM keySpaceTest.catalog_category";
+ ResultSet resultSet;
+
+ if (withCredentials) {
+ resultSet = performQueryWithAuth(cassandraContainer, query);
+ } else {
+ resultSet = performQuery(cassandraContainer, query);
+ }
+
+ assertThat(resultSet.wasApplied()).as("Query was applied").isTrue();
+ Row row = resultSet.one();
+ assertThat(row.getLong(0)).as("Inserted row is in expected state").isEqualTo(1);
+ assertThat(row.getString(1)).as("Inserted row is in expected state").isEqualTo("test_category");
+ }
+
+ private ResultSet performQuery(CassandraContainer cassandraContainer, String cql) {
+ // cql-session {
+ final CqlSession cqlSession = CqlSession
+ .builder()
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .build();
+ // }
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQueryWithAuth(CassandraContainer cassandraContainer, String cql) {
+ final CqlSession cqlSession = CqlSession
+ .builder()
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .withAuthCredentials(cassandraContainer.getUsername(), cassandraContainer.getPassword())
+ .build();
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQueryWithSslClientConfig(CassandraContainer cassandraContainer, String cql) {
+ final ProgrammaticDriverConfigLoaderBuilder driverConfigLoaderBuilder = DriverConfigLoader.programmaticBuilder();
+ driverConfigLoaderBuilder.withBoolean(DefaultDriverOption.SSL_HOSTNAME_VALIDATION, false);
+ final URL trustStoreUrl =
+ this.getClass().getClassLoader().getResource("cassandra-ssl-configuration/truststore.p12");
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_TRUSTSTORE_PATH, trustStoreUrl.getFile());
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_TRUSTSTORE_PASSWORD, "cassandra");
+ final URL keyStoreUrl =
+ this.getClass().getClassLoader().getResource("cassandra-ssl-configuration/keystore.p12");
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_KEYSTORE_PATH, keyStoreUrl.getFile());
+ driverConfigLoaderBuilder.withString(DefaultDriverOption.SSL_KEYSTORE_PASSWORD, "cassandra");
+ final DriverContext driverContext = new DefaultDriverContext(
+ driverConfigLoaderBuilder.build(),
+ ProgrammaticArguments.builder().build()
+ );
+
+ final CqlSessionBuilder sessionBuilder = CqlSession.builder();
+ final CqlSession cqlSession = sessionBuilder
+ .addContactPoint(cassandraContainer.getContactPoint())
+ .withLocalDatacenter(cassandraContainer.getLocalDatacenter())
+ .withSslEngineFactory(new DefaultSslEngineFactory(driverContext))
+ .build();
+ return performQuery(cqlSession, cql);
+ }
+
+ private ResultSet performQuery(CqlSession session, String cql) {
+ final ResultSet rs = session.execute(cql);
+ session.close();
+ return rs;
+ }
+}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java
new file mode 100644
index 00000000000..15d8e209911
--- /dev/null
+++ b/modules/cassandra/src/test/java/org/testcontainers/cassandra/CompatibleCassandraImageTest.java
@@ -0,0 +1,44 @@
+package org.testcontainers.cassandra;
+
+import com.datastax.oss.driver.api.core.CqlIdentifier;
+import com.datastax.oss.driver.api.core.CqlSession;
+import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class CompatibleCassandraImageTest {
+
+ public static String[] params() {
+ return new String[] { "cassandra:3.11.2", "cassandra:4.1.1", "cassandra:5" };
+ }
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void testCassandraGetContactPoint(String imageName) {
+ try (CassandraContainer cassandra = new CassandraContainer(imageName)) {
+ cassandra.start();
+ assertCassandraFunctionality(cassandra);
+ }
+ }
+
+ private void assertCassandraFunctionality(CassandraContainer cassandra) {
+ try (
+ CqlSession session = CqlSession
+ .builder()
+ .addContactPoint(cassandra.getContactPoint())
+ .withLocalDatacenter(cassandra.getLocalDatacenter())
+ .build()
+ ) {
+ session.execute(
+ "CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
+ "{'class':'SimpleStrategy','replication_factor':'1'};"
+ );
+
+ KeyspaceMetadata keyspace = session.getMetadata().getKeyspaces().get(CqlIdentifier.fromCql("test"));
+
+ assertThat(keyspace).as("test keyspace created").isNotNull();
+ }
+ }
+}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
index d8f21fc3068..2d534bccc81 100644
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
+++ b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraContainerTest.java
@@ -5,17 +5,15 @@
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import lombok.extern.slf4j.Slf4j;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.testcontainers.containers.wait.CassandraQueryWaitStrategy;
import org.testcontainers.utility.DockerImageName;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
-/**
- * @author Eugeny Karpov
- */
@Slf4j
-public class CassandraContainerTest {
+class CassandraContainerTest {
private static final DockerImageName CASSANDRA_IMAGE = DockerImageName.parse("cassandra:3.11.2");
@@ -24,7 +22,7 @@ public class CassandraContainerTest {
private static final String BASIC_QUERY = "SELECT release_version FROM system.local";
@Test
- public void testSimple() {
+ void testSimple() {
try (CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)) {
cassandraContainer.start();
ResultSet resultSet = performQuery(cassandraContainer, BASIC_QUERY);
@@ -34,7 +32,7 @@ public void testSimple() {
}
@Test
- public void testSpecificVersion() {
+ void testSpecificVersion() {
String cassandraVersion = "3.0.15";
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(
@@ -49,7 +47,7 @@ public void testSpecificVersion() {
}
@Test
- public void testConfigurationOverride() {
+ void testConfigurationOverride() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withConfigurationOverride("cassandra-test-configuration-example")
@@ -63,18 +61,18 @@ public void testConfigurationOverride() {
}
}
- @Test(expected = ContainerLaunchException.class)
- public void testEmptyConfigurationOverride() {
+ @Test
+ void testEmptyConfigurationOverride() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withConfigurationOverride("cassandra-empty-configuration")
) {
- cassandraContainer.start();
+ assertThatThrownBy(cassandraContainer::start).isInstanceOf(ContainerLaunchException.class);
}
}
@Test
- public void testInitScript() {
+ void testInitScript() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(CASSANDRA_IMAGE)
.withInitScript("initial.cql")
@@ -85,7 +83,7 @@ public void testInitScript() {
}
@Test
- public void testInitScriptWithLegacyCassandra() {
+ void testInitScriptWithLegacyCassandra() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>(
DockerImageName.parse("cassandra:2.2.11")
@@ -99,7 +97,7 @@ public void testInitScriptWithLegacyCassandra() {
@SuppressWarnings("deprecation") // Using deprecated constructor for verification of backwards compatibility
@Test
- public void testCassandraQueryWaitStrategy() {
+ void testCassandraQueryWaitStrategy() {
try (
CassandraContainer> cassandraContainer = new CassandraContainer<>()
.waitingFor(new CassandraQueryWaitStrategy())
@@ -112,7 +110,7 @@ public void testCassandraQueryWaitStrategy() {
@SuppressWarnings("deprecation") // Using deprecated constructor for verification of backwards compatibility
@Test
- public void testCassandraGetCluster() {
+ void testCassandraGetCluster() {
try (CassandraContainer> cassandraContainer = new CassandraContainer<>()) {
cassandraContainer.start();
ResultSet resultSet = performQuery(cassandraContainer.getCluster(), BASIC_QUERY);
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java
deleted file mode 100644
index 502f2ca8e67..00000000000
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver3Test.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.testcontainers.containers;
-
-import com.datastax.oss.driver.api.core.CqlIdentifier;
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class CassandraDriver3Test {
-
- @Rule
- public CassandraContainer> cassandra = new CassandraContainer<>("cassandra:3.11.2");
-
- @Test
- public void testCassandraGetContactPoint() {
- try (
- // cassandra {
- CqlSession session = CqlSession
- .builder()
- .addContactPoint(this.cassandra.getContactPoint())
- .withLocalDatacenter(this.cassandra.getLocalDatacenter())
- .build()
- // }
- ) {
- session.execute(
- "CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
- "{'class':'SimpleStrategy','replication_factor':'1'};"
- );
-
- KeyspaceMetadata keyspace = session.getMetadata().getKeyspaces().get(CqlIdentifier.fromCql("test"));
-
- assertThat(keyspace).as("keyspace created").isNotNull();
- }
- }
-}
diff --git a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java b/modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
similarity index 50%
rename from modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java
rename to modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
index a4fb8c87b8e..aec27566beb 100644
--- a/modules/cassandra/src/test/java/org/testcontainers/containers/CassandraDriver4Test.java
+++ b/modules/cassandra/src/test/java/org/testcontainers/containers/CompatibleCassandraImageTest.java
@@ -3,23 +3,32 @@
import com.datastax.oss.driver.api.core.CqlIdentifier;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
-public class CassandraDriver4Test {
+public class CompatibleCassandraImageTest {
- @Rule
- public CassandraContainer> cassandra = new CassandraContainer<>("cassandra:3.11.2");
+ public static String[] params() {
+ return new String[] { "cassandra:3.11.2", "cassandra:4.1.1" };
+ }
+
+ @ParameterizedTest
+ @MethodSource("params")
+ void testCassandraGetContactPoint(String imageName) {
+ try (CassandraContainer> cassandra = new CassandraContainer<>(imageName)) {
+ cassandra.start();
+ assertCassandraFunctionality(cassandra);
+ }
+ }
- @Test
- public void testCassandraGetContactPoint() {
+ private void assertCassandraFunctionality(CassandraContainer> cassandra) {
try (
CqlSession session = CqlSession
.builder()
- .addContactPoint(this.cassandra.getContactPoint())
- .withLocalDatacenter(this.cassandra.getLocalDatacenter())
+ .addContactPoint(cassandra.getContactPoint())
+ .withLocalDatacenter(cassandra.getLocalDatacenter())
.build()
) {
session.execute(
diff --git a/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml
new file mode 100644
index 00000000000..7425881b8fe
--- /dev/null
+++ b/modules/cassandra/src/test/resources/cassandra-auth-required-configuration/cassandra.yaml
@@ -0,0 +1,1233 @@
+# Cassandra storage config YAML
+
+# NOTE:
+# See http://wiki.apache.org/cassandra/StorageConfiguration for
+# full explanations of configuration directives
+# /NOTE
+
+# The name of the cluster. This is mainly used to prevent machines in
+# one logical cluster from joining another.
+cluster_name: 'Test Cluster Integration Test'
+
+# This defines the number of tokens randomly assigned to this node on the ring
+# The more tokens, relative to other nodes, the larger the proportion of data
+# that this node will store. You probably want all nodes to have the same number
+# of tokens assuming they have equal hardware capability.
+#
+# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility,
+# and will use the initial_token as described below.
+#
+# Specifying initial_token will override this setting on the node's initial start,
+# on subsequent starts, this setting will apply even if initial token is set.
+#
+# If you already have a cluster with 1 token per node, and wish to migrate to
+# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
+num_tokens: 256
+
+# Triggers automatic allocation of num_tokens tokens for this node. The allocation
+# algorithm attempts to choose tokens in a way that optimizes replicated load over
+# the nodes in the datacenter for the replication strategy used by the specified
+# keyspace.
+#
+# The load assigned to each node will be close to proportional to its number of
+# vnodes.
+#
+# Only supported with the Murmur3Partitioner.
+# allocate_tokens_for_keyspace: KEYSPACE
+
+# initial_token allows you to specify tokens manually. While you can use it with
+# vnodes (num_tokens > 1, above) -- in which case you should provide a
+# comma-separated list -- it's primarily used when adding nodes to legacy clusters
+# that do not have vnodes enabled.
+# initial_token:
+
+# See http://wiki.apache.org/cassandra/HintedHandoff
+# May either be "true" or "false" to enable globally
+hinted_handoff_enabled: true
+
+# When hinted_handoff_enabled is true, a black list of data centers that will not
+# perform hinted handoff
+# hinted_handoff_disabled_datacenters:
+# - DC1
+# - DC2
+
+# this defines the maximum amount of time a dead host will have hints
+# generated. After it has been dead this long, new hints for it will not be
+# created until it has been seen alive and gone down again.
+max_hint_window_in_ms: 10800000 # 3 hours
+
+# Maximum throttle in KBs per second, per delivery thread. This will be
+# reduced proportionally to the number of nodes in the cluster. (If there
+# are two nodes in the cluster, each delivery thread will use the maximum
+# rate; if there are three, each will throttle to half of the maximum,
+# since we expect two nodes to be delivering hints simultaneously.)
+hinted_handoff_throttle_in_kb: 1024
+
+# Number of threads with which to deliver hints;
+# Consider increasing this number when you have multi-dc deployments, since
+# cross-dc handoff tends to be slower
+max_hints_delivery_threads: 2
+
+# Directory where Cassandra should store hints.
+# If not set, the default directory is $CASSANDRA_HOME/data/hints.
+# hints_directory: /var/lib/cassandra/hints
+
+# How often hints should be flushed from the internal buffers to disk.
+# Will *not* trigger fsync.
+hints_flush_period_in_ms: 10000
+
+# Maximum size for a single hints file, in megabytes.
+max_hints_file_size_in_mb: 128
+
+# Compression to apply to the hint files. If omitted, hints files
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+#hints_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# Maximum throttle in KBs per second, total. This will be
+# reduced proportionally to the number of nodes in the cluster.
+batchlog_replay_throttle_in_kb: 1024
+
+# Authentication backend, implementing IAuthenticator; used to identify users
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator,
+# PasswordAuthenticator}.
+#
+# - AllowAllAuthenticator performs no checks - set it to disable authentication.
+# - PasswordAuthenticator relies on username/password pairs to authenticate
+# users. It keeps usernames and hashed passwords in system_auth.roles table.
+# Please increase system_auth keyspace replication factor if you use this authenticator.
+# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below)
+authenticator: PasswordAuthenticator
+
+# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer,
+# CassandraAuthorizer}.
+#
+# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
+# - CassandraAuthorizer stores permissions in system_auth.role_permissions table. Please
+# increase system_auth keyspace replication factor if you use this authorizer.
+authorizer: AllowAllAuthorizer
+
+# Part of the Authentication & Authorization backend, implementing IRoleManager; used
+# to maintain grants and memberships between roles.
+# Out of the box, Cassandra provides org.apache.cassandra.auth.CassandraRoleManager,
+# which stores role information in the system_auth keyspace. Most functions of the
+# IRoleManager require an authenticated login, so unless the configured IAuthenticator
+# actually implements authentication, most of this functionality will be unavailable.
+#
+# - CassandraRoleManager stores role data in the system_auth keyspace. Please
+# increase system_auth keyspace replication factor if you use this role manager.
+role_manager: CassandraRoleManager
+
+# Validity period for roles cache (fetching granted roles can be an expensive
+# operation depending on the role manager, CassandraRoleManager is one example)
+# Granted roles are cached for authenticated sessions in AuthenticatedUser and
+# after the period specified here, become eligible for (async) reload.
+# Defaults to 2000, set to 0 to disable caching entirely.
+# Will be disabled automatically for AllowAllAuthenticator.
+roles_validity_in_ms: 2000
+
+# Refresh interval for roles cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If roles_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as roles_validity_in_ms.
+# roles_update_interval_in_ms: 2000
+
+# Validity period for permissions cache (fetching permissions can be an
+# expensive operation depending on the authorizer, CassandraAuthorizer is
+# one example). Defaults to 2000, set to 0 to disable.
+# Will be disabled automatically for AllowAllAuthorizer.
+permissions_validity_in_ms: 2000
+
+# Refresh interval for permissions cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If permissions_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as permissions_validity_in_ms.
+# permissions_update_interval_in_ms: 2000
+
+# Validity period for credentials cache. This cache is tightly coupled to
+# the provided PasswordAuthenticator implementation of IAuthenticator. If
+# another IAuthenticator implementation is configured, this cache will not
+# be automatically used and so the following settings will have no effect.
+# Please note, credentials are cached in their encrypted form, so while
+# activating this cache may reduce the number of queries made to the
+# underlying table, it may not bring a significant reduction in the
+# latency of individual authentication attempts.
+# Defaults to 2000, set to 0 to disable credentials caching.
+credentials_validity_in_ms: 2000
+
+# Refresh interval for credentials cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If credentials_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as credentials_validity_in_ms.
+# credentials_update_interval_in_ms: 2000
+
+# The partitioner is responsible for distributing groups of rows (by
+# partition key) across nodes in the cluster. You should leave this
+# alone for new clusters. The partitioner can NOT be changed without
+# reloading all data, so when upgrading you should set this to the
+# same partitioner you were already using.
+#
+# Besides Murmur3Partitioner, partitioners included for backwards
+# compatibility include RandomPartitioner, ByteOrderedPartitioner, and
+# OrderPreservingPartitioner.
+#
+partitioner: org.apache.cassandra.dht.Murmur3Partitioner
+
+# Directories where Cassandra should store data on disk. Cassandra
+# will spread data evenly across them, subject to the granularity of
+# the configured compaction strategy.
+# If not set, the default directory is $CASSANDRA_HOME/data/data.
+data_file_directories:
+ - /var/lib/cassandra/data
+
+# commit log. when running on magnetic HDD, this should be a
+# separate spindle than the data directories.
+# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
+commitlog_directory: /var/lib/cassandra/commitlog
+
+# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
+# for write path allocation rejection (standard: never reject. cdc: reject Mutation
+# containing a CDC-enabled table if at space limit in cdc_raw_directory).
+cdc_enabled: false
+
+# CommitLogSegments are moved to this directory on flush if cdc_enabled: true and the
+# segment contains mutations for a CDC-enabled table. This should be placed on a
+# separate spindle than the data directories. If not set, the default directory is
+# $CASSANDRA_HOME/data/cdc_raw.
+# cdc_raw_directory: /var/lib/cassandra/cdc_raw
+
+# Policy for data disk failures:
+#
+# die
+# shut down gossip and client transports and kill the JVM for any fs errors or
+# single-sstable errors, so the node can be replaced.
+#
+# stop_paranoid
+# shut down gossip and client transports even for single-sstable errors,
+# kill the JVM for errors during startup.
+#
+# stop
+# shut down gossip and client transports, leaving the node effectively dead, but
+# can still be inspected via JMX, kill the JVM for errors during startup.
+#
+# best_effort
+# stop using the failed disk and respond to requests based on
+# remaining available sstables. This means you WILL see obsolete
+# data at CL.ONE!
+#
+# ignore
+# ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
+disk_failure_policy: stop
+
+# Policy for commit disk failures:
+#
+# die
+# shut down gossip and Thrift and kill the JVM, so the node can be replaced.
+#
+# stop
+# shut down gossip and Thrift, leaving the node effectively dead, but
+# can still be inspected via JMX.
+#
+# stop_commit
+# shutdown the commit log, letting writes collect but
+# continuing to service reads, as in pre-2.0.5 Cassandra
+#
+# ignore
+# ignore fatal errors and let the batches fail
+commit_failure_policy: stop
+
+# Maximum size of the native protocol prepared statement cache
+#
+# Valid values are either "auto" (omitting the value) or a value greater 0.
+#
+# Note that specifying a too large value will result in long running GCs and possibly
+# out-of-memory errors. Keep the value at a small fraction of the heap.
+#
+# If you constantly see "prepared statements discarded in the last minute because
+# cache limit reached" messages, the first step is to investigate the root cause
+# of these messages and check whether prepared statements are used correctly -
+# i.e. use bind markers for variable parts.
+#
+# Do only change the default value, if you really have more prepared statements than
+# fit in the cache. In most cases it is not necessary to change this value.
+# Constantly re-preparing statements is a performance penalty.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+prepared_statements_cache_size_mb:
+
+# Maximum size of the Thrift prepared statement cache
+#
+# If you do not use Thrift at all, it is safe to leave this value at "auto".
+#
+# See description of 'prepared_statements_cache_size_mb' above for more information.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+thrift_prepared_statements_cache_size_mb:
+
+# Maximum size of the key cache in memory.
+#
+# Each key cache hit saves 1 seek and each row cache hit saves 2 seeks at the
+# minimum, sometimes more. The key cache is fairly tiny for the amount of
+# time it saves, so it's worthwhile to use it at large numbers.
+# The row cache saves even more time, but must contain the entire row,
+# so it is extremely space-intensive. It's best to only use the
+# row cache if you have hot rows or static rows.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
+key_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the key cache. Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 14400 or 4 hours.
+key_cache_save_period: 14400
+
+# Number of keys from the key cache to save
+# Disabled by default, meaning all keys are going to be saved
+# key_cache_keys_to_save: 100
+
+# Row cache implementation class name. Available implementations:
+#
+# org.apache.cassandra.cache.OHCProvider
+# Fully off-heap row cache implementation (default).
+#
+# org.apache.cassandra.cache.SerializingCacheProvider
+# This is the row cache implementation available
+# in previous releases of Cassandra.
+# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
+
+# Maximum size of the row cache in memory.
+# Please note that OHC cache implementation requires some additional off-heap memory to manage
+# the map structures and some in-flight memory during operations before/after cache entries can be
+# accounted against the cache capacity. This overhead is usually small compared to the whole capacity.
+# Do not specify more memory that the system can afford in the worst usual situation and leave some
+# headroom for OS block level cache. Do never allow your system to swap.
+#
+# Default value is 0, to disable row caching.
+row_cache_size_in_mb: 0
+
+# Duration in seconds after which Cassandra should save the row cache.
+# Caches are saved to saved_caches_directory as specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 0 to disable saving the row cache.
+row_cache_save_period: 0
+
+# Number of keys from the row cache to save.
+# Specify 0 (which is the default), meaning all keys are going to be saved
+# row_cache_keys_to_save: 100
+
+# Maximum size of the counter cache in memory.
+#
+# Counter cache helps to reduce counter locks' contention for hot counter cells.
+# In case of RF = 1 a counter cache hit will cause Cassandra to skip the read before
+# write entirely. With RF > 1 a counter cache hit will still help to reduce the duration
+# of the lock hold, helping with hot counter cell updates, but will not allow skipping
+# the read entirely. Only the local (clock, count) tuple of a counter cell is kept
+# in memory, not the whole counter, so it's relatively cheap.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache.
+# NOTE: if you perform counter deletes and rely on low gcgs, you should disable the counter cache.
+counter_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the counter cache (keys only). Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Default is 7200 or 2 hours.
+counter_cache_save_period: 7200
+
+# Number of keys from the counter cache to save
+# Disabled by default, meaning all keys are going to be saved
+# counter_cache_keys_to_save: 100
+
+# saved caches
+# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
+saved_caches_directory: /var/lib/cassandra/saved_caches
+
+# commitlog_sync may be either "periodic" or "batch."
+#
+# When in batch mode, Cassandra won't ack writes until the commit log
+# has been fsynced to disk. It will wait
+# commitlog_sync_batch_window_in_ms milliseconds between fsyncs.
+# This window should be kept short because the writer threads will
+# be unable to do extra work while waiting. (You may need to increase
+# concurrent_writes for the same reason.)
+#
+# commitlog_sync: batch
+# commitlog_sync_batch_window_in_ms: 2
+#
+# the other option is "periodic" where writes may be acked immediately
+# and the CommitLog is simply synced every commitlog_sync_period_in_ms
+# milliseconds.
+commitlog_sync: periodic
+commitlog_sync_period_in_ms: 10000
+
+# The size of the individual commitlog file segments. A commitlog
+# segment may be archived, deleted, or recycled once all the data
+# in it (potentially from each columnfamily in the system) has been
+# flushed to sstables.
+#
+# The default size is 32, which is almost always fine, but if you are
+# archiving commitlog segments (see commitlog_archiving.properties),
+# then you probably want a finer granularity of archiving; 8 or 16 MB
+# is reasonable.
+# Max mutation size is also configurable via max_mutation_size_in_kb setting in
+# cassandra.yaml. The default is half the size commitlog_segment_size_in_mb * 1024.
+# This should be positive and less than 2048.
+#
+# NOTE: If max_mutation_size_in_kb is set explicitly then commitlog_segment_size_in_mb must
+# be set to at least twice the size of max_mutation_size_in_kb / 1024
+#
+commitlog_segment_size_in_mb: 32
+
+# Compression to apply to the commit log. If omitted, the commit log
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+# commitlog_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# any class that implements the SeedProvider interface and has a
+# constructor that takes a Map of parameters will do.
+seed_provider:
+ # Addresses of hosts that are deemed contact points.
+ # Cassandra nodes use this list of hosts to find each other and learn
+ # the topology of the ring. You must change this if you are running
+ # multiple nodes!
+ - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+ parameters:
+ # seeds is actually a comma-delimited list of addresses.
+ # Ex: ",,"
+ - seeds: "172.17.0.2"
+
+# For workloads with more data than can fit in memory, Cassandra's
+# bottleneck will be reads that need to fetch data from
+# disk. "concurrent_reads" should be set to (16 * number_of_drives) in
+# order to allow the operations to enqueue low enough in the stack
+# that the OS and drives can reorder them. Same applies to
+# "concurrent_counter_writes", since counter writes read the current
+# values before incrementing and writing them back.
+#
+# On the other hand, since writes are almost never IO bound, the ideal
+# number of "concurrent_writes" is dependent on the number of cores in
+# your system; (8 * number_of_cores) is a good rule of thumb.
+concurrent_reads: 32
+concurrent_writes: 32
+concurrent_counter_writes: 32
+
+# For materialized view writes, as there is a read involved, so this should
+# be limited by the less of concurrent reads or concurrent writes.
+concurrent_materialized_view_writes: 32
+
+# Maximum memory to use for sstable chunk cache and buffer pooling.
+# 32MB of this are reserved for pooling buffers, the rest is used as a
+# cache that holds uncompressed sstable chunks.
+# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
+# so is in addition to the memory allocated for heap. The cache also has on-heap
+# overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
+# if the default 64k chunk size is used).
+# Memory is only allocated when needed.
+# file_cache_size_in_mb: 512
+
+# Flag indicating whether to allocate on or off heap when the sstable buffer
+# pool is exhausted, that is when it has exceeded the maximum memory
+# file_cache_size_in_mb, beyond which it will not cache buffers but allocate on request.
+
+# buffer_pool_use_heap_if_exhausted: true
+
+# The strategy for optimizing disk read
+# Possible values are:
+# ssd (for solid state disks, the default)
+# spinning (for spinning disks)
+# disk_optimization_strategy: ssd
+
+# Total permitted memory to use for memtables. Cassandra will stop
+# accepting writes when the limit is exceeded until a flush completes,
+# and will trigger a flush based on memtable_cleanup_threshold
+# If omitted, Cassandra will set both to 1/4 the size of the heap.
+# memtable_heap_space_in_mb: 2048
+# memtable_offheap_space_in_mb: 2048
+
+# memtable_cleanup_threshold is deprecated. The default calculation
+# is the only reasonable choice. See the comments on memtable_flush_writers
+# for more information.
+#
+# Ratio of occupied non-flushing memtable size to total permitted size
+# that will trigger a flush of the largest memtable. Larger mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+# memtable_cleanup_threshold: 0.11
+
+# Specify the way Cassandra allocates and manages memtable memory.
+# Options are:
+#
+# heap_buffers
+# on heap nio buffers
+#
+# offheap_buffers
+# off heap (direct) nio buffers
+#
+# offheap_objects
+# off heap objects
+memtable_allocation_type: heap_buffers
+
+# Total space to use for commit logs on disk.
+#
+# If space gets above this value, Cassandra will flush every dirty CF
+# in the oldest segment and remove it. So a small total commitlog space
+# will tend to cause more flush activity on less-active columnfamilies.
+#
+# The default value is the smaller of 8192, and 1/4 of the total space
+# of the commitlog volume.
+#
+# commitlog_total_space_in_mb: 8192
+
+# This sets the number of memtable flush writer threads per disk
+# as well as the total number of memtables that can be flushed concurrently.
+# These are generally a combination of compute and IO bound.
+#
+# Memtable flushing is more CPU efficient than memtable ingest and a single thread
+# can keep up with the ingest rate of a whole server on a single fast disk
+# until it temporarily becomes IO bound under contention typically with compaction.
+# At that point you need multiple flush threads. At some point in the future
+# it may become CPU bound all the time.
+#
+# You can tell if flushing is falling behind using the MemtablePool.BlockedOnAllocation
+# metric which should be 0, but will be non-zero if threads are blocked waiting on flushing
+# to free memory.
+#
+# memtable_flush_writers defaults to two for a single data directory.
+# This means that two memtables can be flushed concurrently to the single data directory.
+# If you have multiple data directories the default is one memtable flushing at a time
+# but the flush will use a thread per data directory so you will get two or more writers.
+#
+# Two is generally enough to flush on a fast disk [array] mounted as a single data directory.
+# Adding more flush writers will result in smaller more frequent flushes that introduce more
+# compaction overhead.
+#
+# There is a direct tradeoff between number of memtables that can be flushed concurrently
+# and flush size and frequency. More is not better you just need enough flush writers
+# to never stall waiting for flushing to free memory.
+#
+#memtable_flush_writers: 2
+
+# Total space to use for change-data-capture logs on disk.
+#
+# If space gets above this value, Cassandra will throw WriteTimeoutException
+# on Mutations including tables with CDC enabled. A CDCCompactor is responsible
+# for parsing the raw CDC logs and deleting them when parsing is completed.
+#
+# The default value is the min of 4096 mb and 1/8th of the total space
+# of the drive where cdc_raw_directory resides.
+# cdc_total_space_in_mb: 4096
+
+# When we hit our cdc_raw limit and the CDCCompactor is either running behind
+# or experiencing backpressure, we check at the following interval to see if any
+# new space for cdc-tracked tables has been made available. Default to 250ms
+# cdc_free_space_check_interval_ms: 250
+
+# A fixed memory pool size in MB for SSTable index summaries. If left
+# empty, this will default to 5% of the heap size. If the memory usage of
+# all index summaries exceeds this limit, SSTables with low read rates will
+# shrink their index summaries in order to meet this limit. However, this
+# is a best-effort process. In extreme conditions Cassandra may need to use
+# more than this amount of memory.
+index_summary_capacity_in_mb:
+
+# How frequently index summaries should be resampled. This is done
+# periodically to redistribute memory from the fixed-size pool to sstables
+# proportional their recent read rates. Setting to -1 will disable this
+# process, leaving existing index summaries at their current sampling level.
+index_summary_resize_interval_in_minutes: 60
+
+# Whether to, when doing sequential writing, fsync() at intervals in
+# order to force the operating system to flush the dirty
+# buffers. Enable this to avoid sudden dirty buffer flushing from
+# impacting read latencies. Almost always a good idea on SSDs; not
+# necessarily on platters.
+trickle_fsync: false
+trickle_fsync_interval_in_kb: 10240
+
+# TCP port, for commands and data
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+storage_port: 7000
+
+# SSL port, for encrypted communication. Unused unless enabled in
+# encryption_options
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+ssl_storage_port: 7001
+
+# Address or interface to bind to and tell other Cassandra nodes to connect to.
+# You _must_ change this if you want multiple nodes to be able to communicate!
+#
+# Set listen_address OR listen_interface, not both.
+#
+# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
+# will always do the Right Thing _if_ the node is properly configured
+# (hostname, name resolution, etc), and the Right Thing is to use the
+# address associated with the hostname (it might not be).
+#
+# Setting listen_address to 0.0.0.0 is always wrong.
+#
+listen_address: 172.17.0.2
+
+# Set listen_address OR listen_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# listen_interface: eth0
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using listen_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# listen_interface_prefer_ipv6: false
+
+# Address to broadcast to other Cassandra nodes
+# Leaving this blank will set it to the same value as listen_address
+broadcast_address: 172.17.0.2
+
+# When using multiple physical network interfaces, set this
+# to true to listen on broadcast_address in addition to
+# the listen_address, allowing nodes to communicate in both
+# interfaces.
+# Ignore this property if the network configuration automatically
+# routes between the public and private networks such as EC2.
+# listen_on_broadcast_address: false
+
+# Internode authentication backend, implementing IInternodeAuthenticator;
+# used to allow/disallow connections from peer nodes.
+# internode_authenticator: org.apache.cassandra.auth.AllowAllInternodeAuthenticator
+
+# Whether to start the native transport server.
+# Please note that the address on which the native transport is bound is the
+# same as the rpc_address. The port however is different and specified below.
+start_native_transport: true
+# port for the CQL native transport to listen for clients on
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+native_transport_port: 9042
+# Enabling native transport encryption in client_encryption_options allows you to either use
+# encryption for the standard port or to use a dedicated, additional port along with the unencrypted
+# standard native_transport_port.
+# Enabling client encryption and keeping native_transport_port_ssl disabled will use encryption
+# for native_transport_port. Setting native_transport_port_ssl to a different value
+# from native_transport_port will use encryption for native_transport_port_ssl while
+# keeping native_transport_port unencrypted.
+# native_transport_port_ssl: 9142
+# The maximum threads for handling requests when the native transport is used.
+# This is similar to rpc_max_threads though the default differs slightly (and
+# there is no native_transport_min_threads, idle threads will always be stopped
+# after 30 seconds).
+# native_transport_max_threads: 128
+#
+# The maximum size of allowed frame. Frame (requests) larger than this will
+# be rejected as invalid. The default is 256MB. If you're changing this parameter,
+# you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
+# native_transport_max_frame_size_in_mb: 256
+
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
+# Whether to start the thrift rpc server.
+start_rpc: false
+
+# The address or interface to bind the Thrift RPC service and native transport
+# server to.
+#
+# Set rpc_address OR rpc_interface, not both.
+#
+# Leaving rpc_address blank has the same effect as on listen_address
+# (i.e. it will be based on the configured hostname of the node).
+#
+# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
+# set broadcast_rpc_address to a value other than 0.0.0.0.
+#
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+rpc_address: 0.0.0.0
+
+# Set rpc_address OR rpc_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# rpc_interface: eth1
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using rpc_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# rpc_interface_prefer_ipv6: false
+
+# port for Thrift to listen for clients on
+rpc_port: 9160
+
+# RPC address to broadcast to drivers and other Cassandra nodes. This cannot
+# be set to 0.0.0.0. If left blank, this will be set to the value of
+# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
+# be set.
+broadcast_rpc_address: 172.17.0.2
+
+# enable or disable keepalive on rpc/native connections
+rpc_keepalive: true
+
+# Cassandra provides two out-of-the-box options for the RPC Server:
+#
+# sync
+# One thread per thrift connection. For a very large number of clients, memory
+# will be your limiting factor. On a 64 bit JVM, 180KB is the minimum stack size
+# per thread, and that will correspond to your use of virtual memory (but physical memory
+# may be limited depending on use of stack space).
+#
+# hsha
+# Stands for "half synchronous, half asynchronous." All thrift clients are handled
+# asynchronously using a small number of threads that does not vary with the amount
+# of thrift clients (and thus scales well to many clients). The rpc requests are still
+# synchronous (one thread per active request). If hsha is selected then it is essential
+# that rpc_max_threads is changed from the default value of unlimited.
+#
+# The default is sync because on Windows hsha is about 30% slower. On Linux,
+# sync/hsha performance is about the same, with hsha of course using less memory.
+#
+# Alternatively, can provide your own RPC server by providing the fully-qualified class name
+# of an o.a.c.t.TServerFactory that can create an instance of it.
+rpc_server_type: sync
+
+# Uncomment rpc_min|max_thread to set request pool size limits.
+#
+# Regardless of your choice of RPC server (see above), the number of maximum requests in the
+# RPC thread pool dictates how many concurrent requests are possible (but if you are using the sync
+# RPC server, it also dictates the number of clients that can be connected at all).
+#
+# The default is unlimited and thus provides no protection against clients overwhelming the server. You are
+# encouraged to set a maximum that makes sense for you in production, but do keep in mind that
+# rpc_max_threads represents the maximum number of client requests this server may execute concurrently.
+#
+# rpc_min_threads: 16
+# rpc_max_threads: 2048
+
+# uncomment to set socket buffer sizes on rpc connections
+# rpc_send_buff_size_in_bytes:
+# rpc_recv_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# See also:
+# /proc/sys/net/core/wmem_max
+# /proc/sys/net/core/rmem_max
+# /proc/sys/net/ipv4/tcp_wmem
+# /proc/sys/net/ipv4/tcp_wmem
+# and 'man tcp'
+# internode_send_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# internode_recv_buff_size_in_bytes:
+
+# Frame size for thrift (maximum message length).
+thrift_framed_transport_size_in_mb: 15
+
+# Set to true to have Cassandra create a hard link to each sstable
+# flushed or streamed locally in a backups/ subdirectory of the
+# keyspace data. Removing these links is the operator's
+# responsibility.
+incremental_backups: false
+
+# Whether or not to take a snapshot before each compaction. Be
+# careful using this option, since Cassandra won't clean up the
+# snapshots for you. Mostly useful if you're paranoid when there
+# is a data format change.
+snapshot_before_compaction: false
+
+# Whether or not a snapshot is taken of the data before keyspace truncation
+# or dropping of column families. The STRONGLY advised default of true
+# should be used to provide data safety. If you set this flag to false, you will
+# lose data on truncation or drop.
+auto_snapshot: true
+
+# Granularity of the collation index of rows within a partition.
+# Increase if your rows are large, or if you have a very large
+# number of rows per partition. The competing goals are these:
+#
+# - a smaller granularity means more index entries are generated
+# and looking up rows within the partition by collation column
+# is faster
+# - but, Cassandra will keep the collation index in memory for hot
+# rows (as part of the key cache), so a larger granularity means
+# you can cache more hot rows
+column_index_size_in_kb: 64
+
+# Per sstable indexed key cache entries (the collation index in memory
+# mentioned above) exceeding this size will not be held on heap.
+# This means that only partition information is held on heap and the
+# index entries are read from disk.
+#
+# Note that this size refers to the size of the
+# serialized index information and not the size of the partition.
+column_index_cache_size_in_kb: 2
+
+# Number of simultaneous compactions to allow, NOT including
+# validation "compactions" for anti-entropy repair. Simultaneous
+# compactions can help preserve read performance in a mixed read/write
+# workload, by mitigating the tendency of small sstables to accumulate
+# during a single long running compactions. The default is usually
+# fine and if you experience problems with compaction running too
+# slowly or too fast, you should look at
+# compaction_throughput_mb_per_sec first.
+#
+# concurrent_compactors defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+#
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#concurrent_compactors: 1
+
+# Throttles compaction to the given total throughput across the entire
+# system. The faster you insert data, the faster you need to compact in
+# order to keep the sstable count down, but in general, setting this to
+# 16 to 32 times the rate you are inserting data is more than sufficient.
+# Setting this to 0 disables throttling. Note that this account for all types
+# of compaction, including validation compaction.
+compaction_throughput_mb_per_sec: 16
+
+# When compacting, the replacement sstable(s) can be opened before they
+# are completely written, and used in place of the prior sstables for
+# any range that has been written. This helps to smoothly transfer reads
+# between the sstables, reducing page cache churn and keeping hot rows hot
+sstable_preemptive_open_interval_in_mb: 50
+
+# Throttles all outbound streaming file transfers on this node to the
+# given total throughput in Mbps. This is necessary because Cassandra does
+# mostly sequential IO when streaming data during bootstrap or repair, which
+# can lead to saturating the network connection and degrading rpc performance.
+# When unset, the default is 200 Mbps or 25 MB/s.
+# stream_throughput_outbound_megabits_per_sec: 200
+
+# Throttles all streaming file transfer between the datacenters,
+# this setting allows users to throttle inter dc stream throughput in addition
+# to throttling all network stream traffic as configured with
+# stream_throughput_outbound_megabits_per_sec
+# When unset, the default is 200 Mbps or 25 MB/s
+# inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+
+# How long the coordinator should wait for read operations to complete
+read_request_timeout_in_ms: 5000
+# How long the coordinator should wait for seq or index scans to complete
+range_request_timeout_in_ms: 10000
+# How long the coordinator should wait for writes to complete
+write_request_timeout_in_ms: 2000
+# How long the coordinator should wait for counter writes to complete
+counter_write_request_timeout_in_ms: 5000
+# How long a coordinator should continue to retry a CAS operation
+# that contends with other proposals for the same row
+cas_contention_timeout_in_ms: 1000
+# How long the coordinator should wait for truncates to complete
+# (This can be much longer, because unless auto_snapshot is disabled
+# we need to flush first so we can snapshot before removing the data.)
+truncate_request_timeout_in_ms: 60000
+# The default timeout for other, miscellaneous operations
+request_timeout_in_ms: 10000
+
+# How long before a node logs slow queries. Select queries that take longer than
+# this timeout to execute, will generate an aggregated log message, so that slow queries
+# can be identified. Set this value to zero to disable slow query logging.
+slow_query_log_timeout_in_ms: 500
+
+# Enable operation timeout information exchange between nodes to accurately
+# measure request timeouts. If disabled, replicas will assume that requests
+# were forwarded to them instantly by the coordinator, which means that
+# under overload conditions we will waste that much extra time processing
+# already-timed-out requests.
+#
+# Warning: before enabling this property make sure to ntp is installed
+# and the times are synchronized between the nodes.
+cross_node_timeout: false
+
+# Set keep-alive period for streaming
+# This node will send a keep-alive message periodically with this period.
+# If the node does not receive a keep-alive message from the peer for
+# 2 keep-alive cycles the stream session times out and fail
+# Default value is 300s (5 minutes), which means stalled stream
+# times out in 10 minutes by default
+# streaming_keep_alive_period_in_secs: 300
+
+# phi value that must be reached for a host to be marked down.
+# most users should never need to adjust this.
+# phi_convict_threshold: 8
+
+# endpoint_snitch -- Set this to a class that implements
+# IEndpointSnitch. The snitch has two functions:
+#
+# - it teaches Cassandra enough about your network topology to route
+# requests efficiently
+# - it allows Cassandra to spread replicas around your cluster to avoid
+# correlated failures. It does this by grouping machines into
+# "datacenters" and "racks." Cassandra will do its best not to have
+# more than one replica on the same "rack" (which may not actually
+# be a physical location)
+#
+# CASSANDRA WILL NOT ALLOW YOU TO SWITCH TO AN INCOMPATIBLE SNITCH
+# ONCE DATA IS INSERTED INTO THE CLUSTER. This would cause data loss.
+# This means that if you start with the default SimpleSnitch, which
+# locates every node on "rack1" in "datacenter1", your only options
+# if you need to add another datacenter are GossipingPropertyFileSnitch
+# (and the older PFS). From there, if you want to migrate to an
+# incompatible snitch like Ec2Snitch you can do it by adding new nodes
+# under Ec2Snitch (which will locate them in a new "datacenter") and
+# decommissioning the old ones.
+#
+# Out of the box, Cassandra provides:
+#
+# SimpleSnitch:
+# Treats Strategy order as proximity. This can improve cache
+# locality when disabling read repair. Only appropriate for
+# single-datacenter deployments.
+#
+# GossipingPropertyFileSnitch
+# This should be your go-to snitch for production use. The rack
+# and datacenter for the local node are defined in
+# cassandra-rackdc.properties and propagated to other nodes via
+# gossip. If cassandra-topology.properties exists, it is used as a
+# fallback, allowing migration from the PropertyFileSnitch.
+#
+# PropertyFileSnitch:
+# Proximity is determined by rack and data center, which are
+# explicitly configured in cassandra-topology.properties.
+#
+# Ec2Snitch:
+# Appropriate for EC2 deployments in a single Region. Loads Region
+# and Availability Zone information from the EC2 API. The Region is
+# treated as the datacenter, and the Availability Zone as the rack.
+# Only private IPs are used, so this will not work across multiple
+# Regions.
+#
+# Ec2MultiRegionSnitch:
+# Uses public IPs as broadcast_address to allow cross-region
+# connectivity. (Thus, you should set seed addresses to the public
+# IP as well.) You will need to open the storage_port or
+# ssl_storage_port on the public IP firewall. (For intra-Region
+# traffic, Cassandra will switch to the private IP after
+# establishing a connection.)
+#
+# RackInferringSnitch:
+# Proximity is determined by rack and data center, which are
+# assumed to correspond to the 3rd and 2nd octet of each node's IP
+# address, respectively. Unless this happens to match your
+# deployment conventions, this is best used as an example of
+# writing a custom Snitch class and is provided in that spirit.
+#
+# You can use a custom Snitch by setting this to the full class name
+# of the snitch, which will be assumed to be on your classpath.
+endpoint_snitch: SimpleSnitch
+
+# controls how often to perform the more expensive part of host score
+# calculation
+dynamic_snitch_update_interval_in_ms: 100
+# controls how often to reset all host scores, allowing a bad host to
+# possibly recover
+dynamic_snitch_reset_interval_in_ms: 600000
+# if set greater than zero and read_repair_chance is < 1.0, this will allow
+# 'pinning' of replicas to hosts in order to increase cache capacity.
+# The badness threshold will control how much worse the pinned host has to be
+# before the dynamic snitch will prefer other replicas over it. This is
+# expressed as a double which represents a percentage. Thus, a value of
+# 0.2 means Cassandra would continue to prefer the static snitch values
+# until the pinned host was 20% worse than the fastest.
+dynamic_snitch_badness_threshold: 0.1
+
+# request_scheduler -- Set this to a class that implements
+# RequestScheduler, which will schedule incoming client requests
+# according to the specific policy. This is useful for multi-tenancy
+# with a single Cassandra cluster.
+# NOTE: This is specifically for requests from the client and does
+# not affect inter node communication.
+# org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
+# org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
+# client requests to a node with a separate queue for each
+# request_scheduler_id. The scheduler is further customized by
+# request_scheduler_options as described below.
+request_scheduler: org.apache.cassandra.scheduler.NoScheduler
+
+# Scheduler Options vary based on the type of scheduler
+#
+# NoScheduler
+# Has no options
+#
+# RoundRobin
+# throttle_limit
+# The throttle_limit is the number of in-flight
+# requests per client. Requests beyond
+# that limit are queued up until
+# running requests can complete.
+# The value of 80 here is twice the number of
+# concurrent_reads + concurrent_writes.
+# default_weight
+# default_weight is optional and allows for
+# overriding the default which is 1.
+# weights
+# Weights are optional and will default to 1 or the
+# overridden default_weight. The weight translates into how
+# many requests are handled during each turn of the
+# RoundRobin, based on the scheduler id.
+#
+# request_scheduler_options:
+# throttle_limit: 80
+# default_weight: 5
+# weights:
+# Keyspace1: 1
+# Keyspace2: 5
+
+# request_scheduler_id -- An identifier based on which to perform
+# the request scheduling. Currently the only valid option is keyspace.
+# request_scheduler_id: keyspace
+
+# Enable or disable inter-node encryption
+# JVM defaults for supported SSL socket protocols and cipher suites can
+# be replaced using custom encryption options. This is not recommended
+# unless you have policies in place that dictate certain settings, or
+# need to disable vulnerable ciphers or protocols in case the JVM cannot
+# be updated.
+# FIPS compliant settings can be configured at JVM level and should not
+# involve changing encryption settings here:
+# https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/FIPS.html
+# *NOTE* No custom encryption options are enabled at the moment
+# The available internode options are : all, none, dc, rack
+#
+# If set to dc cassandra will encrypt the traffic between the DCs
+# If set to rack cassandra will encrypt the traffic between the racks
+#
+# The passwords used in these options must match the passwords used when generating
+# the keystore and truststore. For instructions on generating these files, see:
+# http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
+#
+server_encryption_options:
+ internode_encryption: none
+ keystore: conf/.keystore
+ keystore_password: cassandra
+ truststore: conf/.truststore
+ truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+ # require_client_auth: false
+ # require_endpoint_verification: false
+
+# enable or disable client/server encryption.
+client_encryption_options:
+ enabled: false
+ # If enabled and optional is set to true encrypted and unencrypted connections are handled.
+ optional: false
+ keystore: conf/.keystore
+ keystore_password: cassandra
+ # require_client_auth: false
+ # Set trustore and truststore_password if require_client_auth is true
+ # truststore: conf/.truststore
+ # truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+
+# internode_compression controls whether traffic between nodes is
+# compressed.
+# Can be:
+#
+# all
+# all traffic is compressed
+#
+# dc
+# traffic between different datacenters is compressed
+#
+# none
+# nothing is compressed.
+internode_compression: dc
+
+# Enable or disable tcp_nodelay for inter-dc communication.
+# Disabling it will result in larger (but fewer) network packets being sent,
+# reducing overhead from the TCP protocol itself, at the cost of increasing
+# latency if you block for cross-datacenter responses.
+inter_dc_tcp_nodelay: false
+
+# TTL for different trace types used during logging of the repair process.
+tracetype_query_ttl: 86400
+tracetype_repair_ttl: 604800
+
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+# This threshold can be adjusted to minimize logging if necessary
+# gc_log_threshold_in_ms: 200
+
+# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
+# INFO level
+# UDFs (user defined functions) are disabled by default.
+# As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
+enable_user_defined_functions: false
+
+# Enables scripted UDFs (JavaScript UDFs).
+# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
+# This option has no effect, if enable_user_defined_functions is false.
+enable_scripted_user_defined_functions: false
+
+# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
+# Lowering this value on Windows can provide much tighter latency and better throughput, however
+# some virtualized environments may see a negative performance impact from changing this setting
+# below their system default. The sysinternals 'clockres' tool can confirm your system's default
+# setting.
+windows_timer_interval: 1
+
+
+# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
+# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
+# the "key_alias" is the only key that will be used for encrypt operations; previously used keys
+# can still (and should!) be in the keystore and will be used on decrypt operations
+# (to handle the case of key rotation).
+#
+# It is strongly recommended to download and install Java Cryptography Extension (JCE)
+# Unlimited Strength Jurisdiction Policy Files for your version of the JDK.
+# (current link: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)
+#
+# Currently, only the following file types are supported for transparent data encryption, although
+# more are coming in future cassandra releases: commitlog, hints
+transparent_data_encryption_options:
+ enabled: false
+ chunk_length_kb: 64
+ cipher: AES/CBC/PKCS5Padding
+ key_alias: testing:1
+ # CBC IV length for AES needs to be 16 bytes (which is also the default size)
+ # iv_length: 16
+ key_provider:
+ - class_name: org.apache.cassandra.security.JKSKeyProvider
+ parameters:
+ - keystore: conf/.keystore
+ keystore_password: cassandra
+ store_type: JCEKS
+ key_password: cassandra
+
+
+#####################
+# SAFETY THRESHOLDS #
+#####################
+
+# When executing a scan, within or across a partition, we need to keep the
+# tombstones seen in memory so we can return them to the coordinator, which
+# will use them to make sure other replicas also know about the deleted rows.
+# With workloads that generate a lot of tombstones, this can cause performance
+# problems and even exhaust the server heap.
+# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
+# Adjust the thresholds here if you understand the dangers and want to
+# scan more tombstones anyway. These thresholds may also be adjusted at runtime
+# using the StorageService mbean.
+tombstone_warn_threshold: 1000
+tombstone_failure_threshold: 100000
+
+# Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
+# Caution should be taken on increasing the size of this threshold as it can lead to node instability.
+batch_size_warn_threshold_in_kb: 5
+
+# Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
+batch_size_fail_threshold_in_kb: 50
+
+# Log WARN on any batches not of type LOGGED than span across more partitions than this limit
+unlogged_batch_across_partitions_warn_threshold: 10
+
+# Log a warning when compacting partitions larger than this value
+compaction_large_partition_warning_threshold_mb: 100
+
+# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# Adjust the threshold based on your application throughput requirement
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+gc_warn_threshold_in_ms: 1000
+
+# Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
+# early. Any value size larger than this threshold will result into marking an SSTable
+# as corrupted. This should be positive and less than 2048.
+# max_value_size_in_mb: 256
+
+# Back-pressure settings #
+# If enabled, the coordinator will apply the back-pressure strategy specified below to each mutation
+# sent to replicas, with the aim of reducing pressure on overloaded replicas.
+back_pressure_enabled: false
+# The back-pressure strategy applied.
+# The default implementation, RateBasedBackPressure, takes three arguments:
+# high ratio, factor, and flow type, and uses the ratio between incoming mutation responses and outgoing mutation requests.
+# If below high ratio, outgoing mutations are rate limited according to the incoming rate decreased by the given factor;
+# if above high ratio, the rate limiting is increased by the given factor;
+# such factor is usually best configured between 1 and 10, use larger values for a faster recovery
+# at the expense of potentially more dropped mutations;
+# the rate limiting is applied according to the flow type: if FAST, it's rate limited at the speed of the fastest replica,
+# if SLOW at the speed of the slowest one.
+# New strategies can be added. Implementors need to implement org.apache.cassandra.net.BackpressureStrategy and
+# provide a public constructor accepting a Map.
+back_pressure_strategy:
+ - class_name: org.apache.cassandra.net.RateBasedBackPressure
+ parameters:
+ - high_ratio: 0.90
+ factor: 5
+ flow: FAST
+
+# Coalescing Strategies #
+# Coalescing multiples messages turns out to significantly boost message processing throughput (think doubling or more).
+# On bare metal, the floor for packet processing throughput is high enough that many applications won't notice, but in
+# virtualized environments, the point at which an application can be bound by network packet processing can be
+# surprisingly low compared to the throughput of task processing that is possible inside a VM. It's not that bare metal
+# doesn't benefit from coalescing messages, it's that the number of packets a bare metal network interface can process
+# is sufficient for many applications such that no load starvation is experienced even without coalescing.
+# There are other benefits to coalescing network messages that are harder to isolate with a simple metric like messages
+# per second. By coalescing multiple tasks together, a network thread can process multiple messages for the cost of one
+# trip to read from a socket, and all the task submission work can be done at the same time reducing context switching
+# and increasing cache friendliness of network message processing.
+# See CASSANDRA-8692 for details.
+
+# Strategy to use for coalescing messages in OutboundTcpConnection.
+# Can be fixed, movingaverage, timehorizon, disabled (default).
+# You can also specify a subclass of CoalescingStrategies.CoalescingStrategy by name.
+# otc_coalescing_strategy: DISABLED
+
+# How many microseconds to wait for coalescing. For fixed strategy this is the amount of time after the first
+# message is received before it will be sent with any accompanying messages. For moving average this is the
+# maximum amount of time that will be waited as well as the interval at which messages must arrive on average
+# for coalescing to be enabled.
+# otc_coalescing_window_us: 200
+
+# Do not try to coalesce messages if we already got that many messages. This should be more than 2 and less than 128.
+# otc_coalescing_enough_coalesced_messages: 8
+
+# How many milliseconds to wait between two expiration runs on the backlog (queue) of the OutboundTcpConnection.
+# Expiration is done if messages are piling up in the backlog. Droppable messages are expired to free the memory
+# taken by expired messages. The interval should be between 0 and 1000, and in most installations the default value
+# will be appropriate. A smaller value could potentially expire messages slightly sooner at the expense of more CPU
+# time and queue contention while iterating the backlog of messages.
+# An interval of 0 disables any wait time, which is the behavior of former Cassandra versions.
+#
+# otc_backlog_expiration_interval_ms: 200
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer
new file mode 100644
index 00000000000..7a6aee6dec4
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.cer differ
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml
new file mode 100644
index 00000000000..116ba3429cf
--- /dev/null
+++ b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/cassandra.yaml
@@ -0,0 +1,1233 @@
+# Cassandra storage config YAML
+
+# NOTE:
+# See http://wiki.apache.org/cassandra/StorageConfiguration for
+# full explanations of configuration directives
+# /NOTE
+
+# The name of the cluster. This is mainly used to prevent machines in
+# one logical cluster from joining another.
+cluster_name: 'Test Cluster Integration Test'
+
+# This defines the number of tokens randomly assigned to this node on the ring
+# The more tokens, relative to other nodes, the larger the proportion of data
+# that this node will store. You probably want all nodes to have the same number
+# of tokens assuming they have equal hardware capability.
+#
+# If you leave this unspecified, Cassandra will use the default of 1 token for legacy compatibility,
+# and will use the initial_token as described below.
+#
+# Specifying initial_token will override this setting on the node's initial start,
+# on subsequent starts, this setting will apply even if initial token is set.
+#
+# If you already have a cluster with 1 token per node, and wish to migrate to
+# multiple tokens per node, see http://wiki.apache.org/cassandra/Operations
+num_tokens: 256
+
+# Triggers automatic allocation of num_tokens tokens for this node. The allocation
+# algorithm attempts to choose tokens in a way that optimizes replicated load over
+# the nodes in the datacenter for the replication strategy used by the specified
+# keyspace.
+#
+# The load assigned to each node will be close to proportional to its number of
+# vnodes.
+#
+# Only supported with the Murmur3Partitioner.
+# allocate_tokens_for_keyspace: KEYSPACE
+
+# initial_token allows you to specify tokens manually. While you can use it with
+# vnodes (num_tokens > 1, above) -- in which case you should provide a
+# comma-separated list -- it's primarily used when adding nodes to legacy clusters
+# that do not have vnodes enabled.
+# initial_token:
+
+# See http://wiki.apache.org/cassandra/HintedHandoff
+# May either be "true" or "false" to enable globally
+hinted_handoff_enabled: true
+
+# When hinted_handoff_enabled is true, a black list of data centers that will not
+# perform hinted handoff
+# hinted_handoff_disabled_datacenters:
+# - DC1
+# - DC2
+
+# this defines the maximum amount of time a dead host will have hints
+# generated. After it has been dead this long, new hints for it will not be
+# created until it has been seen alive and gone down again.
+max_hint_window_in_ms: 10800000 # 3 hours
+
+# Maximum throttle in KBs per second, per delivery thread. This will be
+# reduced proportionally to the number of nodes in the cluster. (If there
+# are two nodes in the cluster, each delivery thread will use the maximum
+# rate; if there are three, each will throttle to half of the maximum,
+# since we expect two nodes to be delivering hints simultaneously.)
+hinted_handoff_throttle_in_kb: 1024
+
+# Number of threads with which to deliver hints;
+# Consider increasing this number when you have multi-dc deployments, since
+# cross-dc handoff tends to be slower
+max_hints_delivery_threads: 2
+
+# Directory where Cassandra should store hints.
+# If not set, the default directory is $CASSANDRA_HOME/data/hints.
+# hints_directory: /var/lib/cassandra/hints
+
+# How often hints should be flushed from the internal buffers to disk.
+# Will *not* trigger fsync.
+hints_flush_period_in_ms: 10000
+
+# Maximum size for a single hints file, in megabytes.
+max_hints_file_size_in_mb: 128
+
+# Compression to apply to the hint files. If omitted, hints files
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+#hints_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# Maximum throttle in KBs per second, total. This will be
+# reduced proportionally to the number of nodes in the cluster.
+batchlog_replay_throttle_in_kb: 1024
+
+# Authentication backend, implementing IAuthenticator; used to identify users
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator,
+# PasswordAuthenticator}.
+#
+# - AllowAllAuthenticator performs no checks - set it to disable authentication.
+# - PasswordAuthenticator relies on username/password pairs to authenticate
+# users. It keeps usernames and hashed passwords in system_auth.roles table.
+# Please increase system_auth keyspace replication factor if you use this authenticator.
+# If using PasswordAuthenticator, CassandraRoleManager must also be used (see below)
+authenticator: AllowAllAuthenticator
+
+# Authorization backend, implementing IAuthorizer; used to limit access/provide permissions
+# Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthorizer,
+# CassandraAuthorizer}.
+#
+# - AllowAllAuthorizer allows any action to any user - set it to disable authorization.
+# - CassandraAuthorizer stores permissions in system_auth.role_permissions table. Please
+# increase system_auth keyspace replication factor if you use this authorizer.
+authorizer: AllowAllAuthorizer
+
+# Part of the Authentication & Authorization backend, implementing IRoleManager; used
+# to maintain grants and memberships between roles.
+# Out of the box, Cassandra provides org.apache.cassandra.auth.CassandraRoleManager,
+# which stores role information in the system_auth keyspace. Most functions of the
+# IRoleManager require an authenticated login, so unless the configured IAuthenticator
+# actually implements authentication, most of this functionality will be unavailable.
+#
+# - CassandraRoleManager stores role data in the system_auth keyspace. Please
+# increase system_auth keyspace replication factor if you use this role manager.
+role_manager: CassandraRoleManager
+
+# Validity period for roles cache (fetching granted roles can be an expensive
+# operation depending on the role manager, CassandraRoleManager is one example)
+# Granted roles are cached for authenticated sessions in AuthenticatedUser and
+# after the period specified here, become eligible for (async) reload.
+# Defaults to 2000, set to 0 to disable caching entirely.
+# Will be disabled automatically for AllowAllAuthenticator.
+roles_validity_in_ms: 2000
+
+# Refresh interval for roles cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If roles_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as roles_validity_in_ms.
+# roles_update_interval_in_ms: 2000
+
+# Validity period for permissions cache (fetching permissions can be an
+# expensive operation depending on the authorizer, CassandraAuthorizer is
+# one example). Defaults to 2000, set to 0 to disable.
+# Will be disabled automatically for AllowAllAuthorizer.
+permissions_validity_in_ms: 2000
+
+# Refresh interval for permissions cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If permissions_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as permissions_validity_in_ms.
+# permissions_update_interval_in_ms: 2000
+
+# Validity period for credentials cache. This cache is tightly coupled to
+# the provided PasswordAuthenticator implementation of IAuthenticator. If
+# another IAuthenticator implementation is configured, this cache will not
+# be automatically used and so the following settings will have no effect.
+# Please note, credentials are cached in their encrypted form, so while
+# activating this cache may reduce the number of queries made to the
+# underlying table, it may not bring a significant reduction in the
+# latency of individual authentication attempts.
+# Defaults to 2000, set to 0 to disable credentials caching.
+credentials_validity_in_ms: 2000
+
+# Refresh interval for credentials cache (if enabled).
+# After this interval, cache entries become eligible for refresh. Upon next
+# access, an async reload is scheduled and the old value returned until it
+# completes. If credentials_validity_in_ms is non-zero, then this must be
+# also.
+# Defaults to the same value as credentials_validity_in_ms.
+# credentials_update_interval_in_ms: 2000
+
+# The partitioner is responsible for distributing groups of rows (by
+# partition key) across nodes in the cluster. You should leave this
+# alone for new clusters. The partitioner can NOT be changed without
+# reloading all data, so when upgrading you should set this to the
+# same partitioner you were already using.
+#
+# Besides Murmur3Partitioner, partitioners included for backwards
+# compatibility include RandomPartitioner, ByteOrderedPartitioner, and
+# OrderPreservingPartitioner.
+#
+partitioner: org.apache.cassandra.dht.Murmur3Partitioner
+
+# Directories where Cassandra should store data on disk. Cassandra
+# will spread data evenly across them, subject to the granularity of
+# the configured compaction strategy.
+# If not set, the default directory is $CASSANDRA_HOME/data/data.
+data_file_directories:
+ - /var/lib/cassandra/data
+
+# commit log. when running on magnetic HDD, this should be a
+# separate spindle than the data directories.
+# If not set, the default directory is $CASSANDRA_HOME/data/commitlog.
+commitlog_directory: /var/lib/cassandra/commitlog
+
+# Enable / disable CDC functionality on a per-node basis. This modifies the logic used
+# for write path allocation rejection (standard: never reject. cdc: reject Mutation
+# containing a CDC-enabled table if at space limit in cdc_raw_directory).
+cdc_enabled: false
+
+# CommitLogSegments are moved to this directory on flush if cdc_enabled: true and the
+# segment contains mutations for a CDC-enabled table. This should be placed on a
+# separate spindle than the data directories. If not set, the default directory is
+# $CASSANDRA_HOME/data/cdc_raw.
+# cdc_raw_directory: /var/lib/cassandra/cdc_raw
+
+# Policy for data disk failures:
+#
+# die
+# shut down gossip and client transports and kill the JVM for any fs errors or
+# single-sstable errors, so the node can be replaced.
+#
+# stop_paranoid
+# shut down gossip and client transports even for single-sstable errors,
+# kill the JVM for errors during startup.
+#
+# stop
+# shut down gossip and client transports, leaving the node effectively dead, but
+# can still be inspected via JMX, kill the JVM for errors during startup.
+#
+# best_effort
+# stop using the failed disk and respond to requests based on
+# remaining available sstables. This means you WILL see obsolete
+# data at CL.ONE!
+#
+# ignore
+# ignore fatal errors and let requests fail, as in pre-1.2 Cassandra
+disk_failure_policy: stop
+
+# Policy for commit disk failures:
+#
+# die
+# shut down gossip and Thrift and kill the JVM, so the node can be replaced.
+#
+# stop
+# shut down gossip and Thrift, leaving the node effectively dead, but
+# can still be inspected via JMX.
+#
+# stop_commit
+# shutdown the commit log, letting writes collect but
+# continuing to service reads, as in pre-2.0.5 Cassandra
+#
+# ignore
+# ignore fatal errors and let the batches fail
+commit_failure_policy: stop
+
+# Maximum size of the native protocol prepared statement cache
+#
+# Valid values are either "auto" (omitting the value) or a value greater 0.
+#
+# Note that specifying a too large value will result in long running GCs and possbily
+# out-of-memory errors. Keep the value at a small fraction of the heap.
+#
+# If you constantly see "prepared statements discarded in the last minute because
+# cache limit reached" messages, the first step is to investigate the root cause
+# of these messages and check whether prepared statements are used correctly -
+# i.e. use bind markers for variable parts.
+#
+# Do only change the default value, if you really have more prepared statements than
+# fit in the cache. In most cases it is not neccessary to change this value.
+# Constantly re-preparing statements is a performance penalty.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+prepared_statements_cache_size_mb:
+
+# Maximum size of the Thrift prepared statement cache
+#
+# If you do not use Thrift at all, it is safe to leave this value at "auto".
+#
+# See description of 'prepared_statements_cache_size_mb' above for more information.
+#
+# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
+thrift_prepared_statements_cache_size_mb:
+
+# Maximum size of the key cache in memory.
+#
+# Each key cache hit saves 1 seek and each row cache hit saves 2 seeks at the
+# minimum, sometimes more. The key cache is fairly tiny for the amount of
+# time it saves, so it's worthwhile to use it at large numbers.
+# The row cache saves even more time, but must contain the entire row,
+# so it is extremely space-intensive. It's best to only use the
+# row cache if you have hot rows or static rows.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
+key_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the key cache. Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 14400 or 4 hours.
+key_cache_save_period: 14400
+
+# Number of keys from the key cache to save
+# Disabled by default, meaning all keys are going to be saved
+# key_cache_keys_to_save: 100
+
+# Row cache implementation class name. Available implementations:
+#
+# org.apache.cassandra.cache.OHCProvider
+# Fully off-heap row cache implementation (default).
+#
+# org.apache.cassandra.cache.SerializingCacheProvider
+# This is the row cache implementation availabile
+# in previous releases of Cassandra.
+# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
+
+# Maximum size of the row cache in memory.
+# Please note that OHC cache implementation requires some additional off-heap memory to manage
+# the map structures and some in-flight memory during operations before/after cache entries can be
+# accounted against the cache capacity. This overhead is usually small compared to the whole capacity.
+# Do not specify more memory that the system can afford in the worst usual situation and leave some
+# headroom for OS block level cache. Do never allow your system to swap.
+#
+# Default value is 0, to disable row caching.
+row_cache_size_in_mb: 0
+
+# Duration in seconds after which Cassandra should save the row cache.
+# Caches are saved to saved_caches_directory as specified in this configuration file.
+#
+# Saved caches greatly improve cold-start speeds, and is relatively cheap in
+# terms of I/O for the key cache. Row cache saving is much more expensive and
+# has limited use.
+#
+# Default is 0 to disable saving the row cache.
+row_cache_save_period: 0
+
+# Number of keys from the row cache to save.
+# Specify 0 (which is the default), meaning all keys are going to be saved
+# row_cache_keys_to_save: 100
+
+# Maximum size of the counter cache in memory.
+#
+# Counter cache helps to reduce counter locks' contention for hot counter cells.
+# In case of RF = 1 a counter cache hit will cause Cassandra to skip the read before
+# write entirely. With RF > 1 a counter cache hit will still help to reduce the duration
+# of the lock hold, helping with hot counter cell updates, but will not allow skipping
+# the read entirely. Only the local (clock, count) tuple of a counter cell is kept
+# in memory, not the whole counter, so it's relatively cheap.
+#
+# NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
+#
+# Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache.
+# NOTE: if you perform counter deletes and rely on low gcgs, you should disable the counter cache.
+counter_cache_size_in_mb:
+
+# Duration in seconds after which Cassandra should
+# save the counter cache (keys only). Caches are saved to saved_caches_directory as
+# specified in this configuration file.
+#
+# Default is 7200 or 2 hours.
+counter_cache_save_period: 7200
+
+# Number of keys from the counter cache to save
+# Disabled by default, meaning all keys are going to be saved
+# counter_cache_keys_to_save: 100
+
+# saved caches
+# If not set, the default directory is $CASSANDRA_HOME/data/saved_caches.
+saved_caches_directory: /var/lib/cassandra/saved_caches
+
+# commitlog_sync may be either "periodic" or "batch."
+#
+# When in batch mode, Cassandra won't ack writes until the commit log
+# has been fsynced to disk. It will wait
+# commitlog_sync_batch_window_in_ms milliseconds between fsyncs.
+# This window should be kept short because the writer threads will
+# be unable to do extra work while waiting. (You may need to increase
+# concurrent_writes for the same reason.)
+#
+# commitlog_sync: batch
+# commitlog_sync_batch_window_in_ms: 2
+#
+# the other option is "periodic" where writes may be acked immediately
+# and the CommitLog is simply synced every commitlog_sync_period_in_ms
+# milliseconds.
+commitlog_sync: periodic
+commitlog_sync_period_in_ms: 10000
+
+# The size of the individual commitlog file segments. A commitlog
+# segment may be archived, deleted, or recycled once all the data
+# in it (potentially from each columnfamily in the system) has been
+# flushed to sstables.
+#
+# The default size is 32, which is almost always fine, but if you are
+# archiving commitlog segments (see commitlog_archiving.properties),
+# then you probably want a finer granularity of archiving; 8 or 16 MB
+# is reasonable.
+# Max mutation size is also configurable via max_mutation_size_in_kb setting in
+# cassandra.yaml. The default is half the size commitlog_segment_size_in_mb * 1024.
+# This should be positive and less than 2048.
+#
+# NOTE: If max_mutation_size_in_kb is set explicitly then commitlog_segment_size_in_mb must
+# be set to at least twice the size of max_mutation_size_in_kb / 1024
+#
+commitlog_segment_size_in_mb: 32
+
+# Compression to apply to the commit log. If omitted, the commit log
+# will be written uncompressed. LZ4, Snappy, and Deflate compressors
+# are supported.
+# commitlog_compression:
+# - class_name: LZ4Compressor
+# parameters:
+# -
+
+# any class that implements the SeedProvider interface and has a
+# constructor that takes a Map of parameters will do.
+seed_provider:
+ # Addresses of hosts that are deemed contact points.
+ # Cassandra nodes use this list of hosts to find each other and learn
+ # the topology of the ring. You must change this if you are running
+ # multiple nodes!
+ - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+ parameters:
+ # seeds is actually a comma-delimited list of addresses.
+ # Ex: ",,"
+ - seeds: "172.17.0.2"
+
+# For workloads with more data than can fit in memory, Cassandra's
+# bottleneck will be reads that need to fetch data from
+# disk. "concurrent_reads" should be set to (16 * number_of_drives) in
+# order to allow the operations to enqueue low enough in the stack
+# that the OS and drives can reorder them. Same applies to
+# "concurrent_counter_writes", since counter writes read the current
+# values before incrementing and writing them back.
+#
+# On the other hand, since writes are almost never IO bound, the ideal
+# number of "concurrent_writes" is dependent on the number of cores in
+# your system; (8 * number_of_cores) is a good rule of thumb.
+concurrent_reads: 32
+concurrent_writes: 32
+concurrent_counter_writes: 32
+
+# For materialized view writes, as there is a read involved, so this should
+# be limited by the less of concurrent reads or concurrent writes.
+concurrent_materialized_view_writes: 32
+
+# Maximum memory to use for sstable chunk cache and buffer pooling.
+# 32MB of this are reserved for pooling buffers, the rest is used as an
+# cache that holds uncompressed sstable chunks.
+# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
+# so is in addition to the memory allocated for heap. The cache also has on-heap
+# overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
+# if the default 64k chunk size is used).
+# Memory is only allocated when needed.
+# file_cache_size_in_mb: 512
+
+# Flag indicating whether to allocate on or off heap when the sstable buffer
+# pool is exhausted, that is when it has exceeded the maximum memory
+# file_cache_size_in_mb, beyond which it will not cache buffers but allocate on request.
+
+# buffer_pool_use_heap_if_exhausted: true
+
+# The strategy for optimizing disk read
+# Possible values are:
+# ssd (for solid state disks, the default)
+# spinning (for spinning disks)
+# disk_optimization_strategy: ssd
+
+# Total permitted memory to use for memtables. Cassandra will stop
+# accepting writes when the limit is exceeded until a flush completes,
+# and will trigger a flush based on memtable_cleanup_threshold
+# If omitted, Cassandra will set both to 1/4 the size of the heap.
+# memtable_heap_space_in_mb: 2048
+# memtable_offheap_space_in_mb: 2048
+
+# memtable_cleanup_threshold is deprecated. The default calculation
+# is the only reasonable choice. See the comments on memtable_flush_writers
+# for more information.
+#
+# Ratio of occupied non-flushing memtable size to total permitted size
+# that will trigger a flush of the largest memtable. Larger mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+# memtable_cleanup_threshold: 0.11
+
+# Specify the way Cassandra allocates and manages memtable memory.
+# Options are:
+#
+# heap_buffers
+# on heap nio buffers
+#
+# offheap_buffers
+# off heap (direct) nio buffers
+#
+# offheap_objects
+# off heap objects
+memtable_allocation_type: heap_buffers
+
+# Total space to use for commit logs on disk.
+#
+# If space gets above this value, Cassandra will flush every dirty CF
+# in the oldest segment and remove it. So a small total commitlog space
+# will tend to cause more flush activity on less-active columnfamilies.
+#
+# The default value is the smaller of 8192, and 1/4 of the total space
+# of the commitlog volume.
+#
+# commitlog_total_space_in_mb: 8192
+
+# This sets the number of memtable flush writer threads per disk
+# as well as the total number of memtables that can be flushed concurrently.
+# These are generally a combination of compute and IO bound.
+#
+# Memtable flushing is more CPU efficient than memtable ingest and a single thread
+# can keep up with the ingest rate of a whole server on a single fast disk
+# until it temporarily becomes IO bound under contention typically with compaction.
+# At that point you need multiple flush threads. At some point in the future
+# it may become CPU bound all the time.
+#
+# You can tell if flushing is falling behind using the MemtablePool.BlockedOnAllocation
+# metric which should be 0, but will be non-zero if threads are blocked waiting on flushing
+# to free memory.
+#
+# memtable_flush_writers defaults to two for a single data directory.
+# This means that two memtables can be flushed concurrently to the single data directory.
+# If you have multiple data directories the default is one memtable flushing at a time
+# but the flush will use a thread per data directory so you will get two or more writers.
+#
+# Two is generally enough to flush on a fast disk [array] mounted as a single data directory.
+# Adding more flush writers will result in smaller more frequent flushes that introduce more
+# compaction overhead.
+#
+# There is a direct tradeoff between number of memtables that can be flushed concurrently
+# and flush size and frequency. More is not better you just need enough flush writers
+# to never stall waiting for flushing to free memory.
+#
+#memtable_flush_writers: 2
+
+# Total space to use for change-data-capture logs on disk.
+#
+# If space gets above this value, Cassandra will throw WriteTimeoutException
+# on Mutations including tables with CDC enabled. A CDCCompactor is responsible
+# for parsing the raw CDC logs and deleting them when parsing is completed.
+#
+# The default value is the min of 4096 mb and 1/8th of the total space
+# of the drive where cdc_raw_directory resides.
+# cdc_total_space_in_mb: 4096
+
+# When we hit our cdc_raw limit and the CDCCompactor is either running behind
+# or experiencing backpressure, we check at the following interval to see if any
+# new space for cdc-tracked tables has been made available. Default to 250ms
+# cdc_free_space_check_interval_ms: 250
+
+# A fixed memory pool size in MB for for SSTable index summaries. If left
+# empty, this will default to 5% of the heap size. If the memory usage of
+# all index summaries exceeds this limit, SSTables with low read rates will
+# shrink their index summaries in order to meet this limit. However, this
+# is a best-effort process. In extreme conditions Cassandra may need to use
+# more than this amount of memory.
+index_summary_capacity_in_mb:
+
+# How frequently index summaries should be resampled. This is done
+# periodically to redistribute memory from the fixed-size pool to sstables
+# proportional their recent read rates. Setting to -1 will disable this
+# process, leaving existing index summaries at their current sampling level.
+index_summary_resize_interval_in_minutes: 60
+
+# Whether to, when doing sequential writing, fsync() at intervals in
+# order to force the operating system to flush the dirty
+# buffers. Enable this to avoid sudden dirty buffer flushing from
+# impacting read latencies. Almost always a good idea on SSDs; not
+# necessarily on platters.
+trickle_fsync: false
+trickle_fsync_interval_in_kb: 10240
+
+# TCP port, for commands and data
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+storage_port: 7000
+
+# SSL port, for encrypted communication. Unused unless enabled in
+# encryption_options
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+ssl_storage_port: 7001
+
+# Address or interface to bind to and tell other Cassandra nodes to connect to.
+# You _must_ change this if you want multiple nodes to be able to communicate!
+#
+# Set listen_address OR listen_interface, not both.
+#
+# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
+# will always do the Right Thing _if_ the node is properly configured
+# (hostname, name resolution, etc), and the Right Thing is to use the
+# address associated with the hostname (it might not be).
+#
+# Setting listen_address to 0.0.0.0 is always wrong.
+#
+listen_address: 172.17.0.2
+
+# Set listen_address OR listen_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# listen_interface: eth0
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using listen_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# listen_interface_prefer_ipv6: false
+
+# Address to broadcast to other Cassandra nodes
+# Leaving this blank will set it to the same value as listen_address
+broadcast_address: 172.17.0.2
+
+# When using multiple physical network interfaces, set this
+# to true to listen on broadcast_address in addition to
+# the listen_address, allowing nodes to communicate in both
+# interfaces.
+# Ignore this property if the network configuration automatically
+# routes between the public and private networks such as EC2.
+# listen_on_broadcast_address: false
+
+# Internode authentication backend, implementing IInternodeAuthenticator;
+# used to allow/disallow connections from peer nodes.
+# internode_authenticator: org.apache.cassandra.auth.AllowAllInternodeAuthenticator
+
+# Whether to start the native transport server.
+# Please note that the address on which the native transport is bound is the
+# same as the rpc_address. The port however is different and specified below.
+start_native_transport: true
+# port for the CQL native transport to listen for clients on
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+native_transport_port: 9042
+# Enabling native transport encryption in client_encryption_options allows you to either use
+# encryption for the standard port or to use a dedicated, additional port along with the unencrypted
+# standard native_transport_port.
+# Enabling client encryption and keeping native_transport_port_ssl disabled will use encryption
+# for native_transport_port. Setting native_transport_port_ssl to a different value
+# from native_transport_port will use encryption for native_transport_port_ssl while
+# keeping native_transport_port unencrypted.
+# native_transport_port_ssl: 9142
+# The maximum threads for handling requests when the native transport is used.
+# This is similar to rpc_max_threads though the default differs slightly (and
+# there is no native_transport_min_threads, idle threads will always be stopped
+# after 30 seconds).
+# native_transport_max_threads: 128
+#
+# The maximum size of allowed frame. Frame (requests) larger than this will
+# be rejected as invalid. The default is 256MB. If you're changing this parameter,
+# you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
+# native_transport_max_frame_size_in_mb: 256
+
+# The maximum number of concurrent client connections.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections: -1
+
+# The maximum number of concurrent client connections per source ip.
+# The default is -1, which means unlimited.
+# native_transport_max_concurrent_connections_per_ip: -1
+
+# Whether to start the thrift rpc server.
+start_rpc: false
+
+# The address or interface to bind the Thrift RPC service and native transport
+# server to.
+#
+# Set rpc_address OR rpc_interface, not both.
+#
+# Leaving rpc_address blank has the same effect as on listen_address
+# (i.e. it will be based on the configured hostname of the node).
+#
+# Note that unlike listen_address, you can specify 0.0.0.0, but you must also
+# set broadcast_rpc_address to a value other than 0.0.0.0.
+#
+# For security reasons, you should not expose this port to the internet. Firewall it if needed.
+rpc_address: 0.0.0.0
+
+# Set rpc_address OR rpc_interface, not both. Interfaces must correspond
+# to a single address, IP aliasing is not supported.
+# rpc_interface: eth1
+
+# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
+# you can specify which should be chosen using rpc_interface_prefer_ipv6. If false the first ipv4
+# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
+# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
+# rpc_interface_prefer_ipv6: false
+
+# port for Thrift to listen for clients on
+rpc_port: 9160
+
+# RPC address to broadcast to drivers and other Cassandra nodes. This cannot
+# be set to 0.0.0.0. If left blank, this will be set to the value of
+# rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must
+# be set.
+broadcast_rpc_address: 172.17.0.2
+
+# enable or disable keepalive on rpc/native connections
+rpc_keepalive: true
+
+# Cassandra provides two out-of-the-box options for the RPC Server:
+#
+# sync
+# One thread per thrift connection. For a very large number of clients, memory
+# will be your limiting factor. On a 64 bit JVM, 180KB is the minimum stack size
+# per thread, and that will correspond to your use of virtual memory (but physical memory
+# may be limited depending on use of stack space).
+#
+# hsha
+# Stands for "half synchronous, half asynchronous." All thrift clients are handled
+# asynchronously using a small number of threads that does not vary with the amount
+# of thrift clients (and thus scales well to many clients). The rpc requests are still
+# synchronous (one thread per active request). If hsha is selected then it is essential
+# that rpc_max_threads is changed from the default value of unlimited.
+#
+# The default is sync because on Windows hsha is about 30% slower. On Linux,
+# sync/hsha performance is about the same, with hsha of course using less memory.
+#
+# Alternatively, can provide your own RPC server by providing the fully-qualified class name
+# of an o.a.c.t.TServerFactory that can create an instance of it.
+rpc_server_type: sync
+
+# Uncomment rpc_min|max_thread to set request pool size limits.
+#
+# Regardless of your choice of RPC server (see above), the number of maximum requests in the
+# RPC thread pool dictates how many concurrent requests are possible (but if you are using the sync
+# RPC server, it also dictates the number of clients that can be connected at all).
+#
+# The default is unlimited and thus provides no protection against clients overwhelming the server. You are
+# encouraged to set a maximum that makes sense for you in production, but do keep in mind that
+# rpc_max_threads represents the maximum number of client requests this server may execute concurrently.
+#
+# rpc_min_threads: 16
+# rpc_max_threads: 2048
+
+# uncomment to set socket buffer sizes on rpc connections
+# rpc_send_buff_size_in_bytes:
+# rpc_recv_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# See also:
+# /proc/sys/net/core/wmem_max
+# /proc/sys/net/core/rmem_max
+# /proc/sys/net/ipv4/tcp_wmem
+# /proc/sys/net/ipv4/tcp_wmem
+# and 'man tcp'
+# internode_send_buff_size_in_bytes:
+
+# Uncomment to set socket buffer size for internode communication
+# Note that when setting this, the buffer size is limited by net.core.wmem_max
+# and when not setting it it is defined by net.ipv4.tcp_wmem
+# internode_recv_buff_size_in_bytes:
+
+# Frame size for thrift (maximum message length).
+thrift_framed_transport_size_in_mb: 15
+
+# Set to true to have Cassandra create a hard link to each sstable
+# flushed or streamed locally in a backups/ subdirectory of the
+# keyspace data. Removing these links is the operator's
+# responsibility.
+incremental_backups: false
+
+# Whether or not to take a snapshot before each compaction. Be
+# careful using this option, since Cassandra won't clean up the
+# snapshots for you. Mostly useful if you're paranoid when there
+# is a data format change.
+snapshot_before_compaction: false
+
+# Whether or not a snapshot is taken of the data before keyspace truncation
+# or dropping of column families. The STRONGLY advised default of true
+# should be used to provide data safety. If you set this flag to false, you will
+# lose data on truncation or drop.
+auto_snapshot: true
+
+# Granularity of the collation index of rows within a partition.
+# Increase if your rows are large, or if you have a very large
+# number of rows per partition. The competing goals are these:
+#
+# - a smaller granularity means more index entries are generated
+# and looking up rows withing the partition by collation column
+# is faster
+# - but, Cassandra will keep the collation index in memory for hot
+# rows (as part of the key cache), so a larger granularity means
+# you can cache more hot rows
+column_index_size_in_kb: 64
+
+# Per sstable indexed key cache entries (the collation index in memory
+# mentioned above) exceeding this size will not be held on heap.
+# This means that only partition information is held on heap and the
+# index entries are read from disk.
+#
+# Note that this size refers to the size of the
+# serialized index information and not the size of the partition.
+column_index_cache_size_in_kb: 2
+
+# Number of simultaneous compactions to allow, NOT including
+# validation "compactions" for anti-entropy repair. Simultaneous
+# compactions can help preserve read performance in a mixed read/write
+# workload, by mitigating the tendency of small sstables to accumulate
+# during a single long running compactions. The default is usually
+# fine and if you experience problems with compaction running too
+# slowly or too fast, you should look at
+# compaction_throughput_mb_per_sec first.
+#
+# concurrent_compactors defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+#
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#concurrent_compactors: 1
+
+# Throttles compaction to the given total throughput across the entire
+# system. The faster you insert data, the faster you need to compact in
+# order to keep the sstable count down, but in general, setting this to
+# 16 to 32 times the rate you are inserting data is more than sufficient.
+# Setting this to 0 disables throttling. Note that this account for all types
+# of compaction, including validation compaction.
+compaction_throughput_mb_per_sec: 16
+
+# When compacting, the replacement sstable(s) can be opened before they
+# are completely written, and used in place of the prior sstables for
+# any range that has been written. This helps to smoothly transfer reads
+# between the sstables, reducing page cache churn and keeping hot rows hot
+sstable_preemptive_open_interval_in_mb: 50
+
+# Throttles all outbound streaming file transfers on this node to the
+# given total throughput in Mbps. This is necessary because Cassandra does
+# mostly sequential IO when streaming data during bootstrap or repair, which
+# can lead to saturating the network connection and degrading rpc performance.
+# When unset, the default is 200 Mbps or 25 MB/s.
+# stream_throughput_outbound_megabits_per_sec: 200
+
+# Throttles all streaming file transfer between the datacenters,
+# this setting allows users to throttle inter dc stream throughput in addition
+# to throttling all network stream traffic as configured with
+# stream_throughput_outbound_megabits_per_sec
+# When unset, the default is 200 Mbps or 25 MB/s
+# inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+
+# How long the coordinator should wait for read operations to complete
+read_request_timeout_in_ms: 5000
+# How long the coordinator should wait for seq or index scans to complete
+range_request_timeout_in_ms: 10000
+# How long the coordinator should wait for writes to complete
+write_request_timeout_in_ms: 2000
+# How long the coordinator should wait for counter writes to complete
+counter_write_request_timeout_in_ms: 5000
+# How long a coordinator should continue to retry a CAS operation
+# that contends with other proposals for the same row
+cas_contention_timeout_in_ms: 1000
+# How long the coordinator should wait for truncates to complete
+# (This can be much longer, because unless auto_snapshot is disabled
+# we need to flush first so we can snapshot before removing the data.)
+truncate_request_timeout_in_ms: 60000
+# The default timeout for other, miscellaneous operations
+request_timeout_in_ms: 10000
+
+# How long before a node logs slow queries. Select queries that take longer than
+# this timeout to execute, will generate an aggregated log message, so that slow queries
+# can be identified. Set this value to zero to disable slow query logging.
+slow_query_log_timeout_in_ms: 500
+
+# Enable operation timeout information exchange between nodes to accurately
+# measure request timeouts. If disabled, replicas will assume that requests
+# were forwarded to them instantly by the coordinator, which means that
+# under overload conditions we will waste that much extra time processing
+# already-timed-out requests.
+#
+# Warning: before enabling this property make sure to ntp is installed
+# and the times are synchronized between the nodes.
+cross_node_timeout: false
+
+# Set keep-alive period for streaming
+# This node will send a keep-alive message periodically with this period.
+# If the node does not receive a keep-alive message from the peer for
+# 2 keep-alive cycles the stream session times out and fail
+# Default value is 300s (5 minutes), which means stalled stream
+# times out in 10 minutes by default
+# streaming_keep_alive_period_in_secs: 300
+
+# phi value that must be reached for a host to be marked down.
+# most users should never need to adjust this.
+# phi_convict_threshold: 8
+
+# endpoint_snitch -- Set this to a class that implements
+# IEndpointSnitch. The snitch has two functions:
+#
+# - it teaches Cassandra enough about your network topology to route
+# requests efficiently
+# - it allows Cassandra to spread replicas around your cluster to avoid
+# correlated failures. It does this by grouping machines into
+# "datacenters" and "racks." Cassandra will do its best not to have
+# more than one replica on the same "rack" (which may not actually
+# be a physical location)
+#
+# CASSANDRA WILL NOT ALLOW YOU TO SWITCH TO AN INCOMPATIBLE SNITCH
+# ONCE DATA IS INSERTED INTO THE CLUSTER. This would cause data loss.
+# This means that if you start with the default SimpleSnitch, which
+# locates every node on "rack1" in "datacenter1", your only options
+# if you need to add another datacenter are GossipingPropertyFileSnitch
+# (and the older PFS). From there, if you want to migrate to an
+# incompatible snitch like Ec2Snitch you can do it by adding new nodes
+# under Ec2Snitch (which will locate them in a new "datacenter") and
+# decommissioning the old ones.
+#
+# Out of the box, Cassandra provides:
+#
+# SimpleSnitch:
+# Treats Strategy order as proximity. This can improve cache
+# locality when disabling read repair. Only appropriate for
+# single-datacenter deployments.
+#
+# GossipingPropertyFileSnitch
+# This should be your go-to snitch for production use. The rack
+# and datacenter for the local node are defined in
+# cassandra-rackdc.properties and propagated to other nodes via
+# gossip. If cassandra-topology.properties exists, it is used as a
+# fallback, allowing migration from the PropertyFileSnitch.
+#
+# PropertyFileSnitch:
+# Proximity is determined by rack and data center, which are
+# explicitly configured in cassandra-topology.properties.
+#
+# Ec2Snitch:
+# Appropriate for EC2 deployments in a single Region. Loads Region
+# and Availability Zone information from the EC2 API. The Region is
+# treated as the datacenter, and the Availability Zone as the rack.
+# Only private IPs are used, so this will not work across multiple
+# Regions.
+#
+# Ec2MultiRegionSnitch:
+# Uses public IPs as broadcast_address to allow cross-region
+# connectivity. (Thus, you should set seed addresses to the public
+# IP as well.) You will need to open the storage_port or
+# ssl_storage_port on the public IP firewall. (For intra-Region
+# traffic, Cassandra will switch to the private IP after
+# establishing a connection.)
+#
+# RackInferringSnitch:
+# Proximity is determined by rack and data center, which are
+# assumed to correspond to the 3rd and 2nd octet of each node's IP
+# address, respectively. Unless this happens to match your
+# deployment conventions, this is best used as an example of
+# writing a custom Snitch class and is provided in that spirit.
+#
+# You can use a custom Snitch by setting this to the full class name
+# of the snitch, which will be assumed to be on your classpath.
+endpoint_snitch: SimpleSnitch
+
+# controls how often to perform the more expensive part of host score
+# calculation
+dynamic_snitch_update_interval_in_ms: 100
+# controls how often to reset all host scores, allowing a bad host to
+# possibly recover
+dynamic_snitch_reset_interval_in_ms: 600000
+# if set greater than zero and read_repair_chance is < 1.0, this will allow
+# 'pinning' of replicas to hosts in order to increase cache capacity.
+# The badness threshold will control how much worse the pinned host has to be
+# before the dynamic snitch will prefer other replicas over it. This is
+# expressed as a double which represents a percentage. Thus, a value of
+# 0.2 means Cassandra would continue to prefer the static snitch values
+# until the pinned host was 20% worse than the fastest.
+dynamic_snitch_badness_threshold: 0.1
+
+# request_scheduler -- Set this to a class that implements
+# RequestScheduler, which will schedule incoming client requests
+# according to the specific policy. This is useful for multi-tenancy
+# with a single Cassandra cluster.
+# NOTE: This is specifically for requests from the client and does
+# not affect inter node communication.
+# org.apache.cassandra.scheduler.NoScheduler - No scheduling takes place
+# org.apache.cassandra.scheduler.RoundRobinScheduler - Round robin of
+# client requests to a node with a separate queue for each
+# request_scheduler_id. The scheduler is further customized by
+# request_scheduler_options as described below.
+request_scheduler: org.apache.cassandra.scheduler.NoScheduler
+
+# Scheduler Options vary based on the type of scheduler
+#
+# NoScheduler
+# Has no options
+#
+# RoundRobin
+# throttle_limit
+# The throttle_limit is the number of in-flight
+# requests per client. Requests beyond
+# that limit are queued up until
+# running requests can complete.
+# The value of 80 here is twice the number of
+# concurrent_reads + concurrent_writes.
+# default_weight
+# default_weight is optional and allows for
+# overriding the default which is 1.
+# weights
+# Weights are optional and will default to 1 or the
+# overridden default_weight. The weight translates into how
+# many requests are handled during each turn of the
+# RoundRobin, based on the scheduler id.
+#
+# request_scheduler_options:
+# throttle_limit: 80
+# default_weight: 5
+# weights:
+# Keyspace1: 1
+# Keyspace2: 5
+
+# request_scheduler_id -- An identifier based on which to perform
+# the request scheduling. Currently the only valid option is keyspace.
+# request_scheduler_id: keyspace
+
+# Enable or disable inter-node encryption
+# JVM defaults for supported SSL socket protocols and cipher suites can
+# be replaced using custom encryption options. This is not recommended
+# unless you have policies in place that dictate certain settings, or
+# need to disable vulnerable ciphers or protocols in case the JVM cannot
+# be updated.
+# FIPS compliant settings can be configured at JVM level and should not
+# involve changing encryption settings here:
+# https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/FIPS.html
+# *NOTE* No custom encryption options are enabled at the moment
+# The available internode options are : all, none, dc, rack
+#
+# If set to dc cassandra will encrypt the traffic between the DCs
+# If set to rack cassandra will encrypt the traffic between the racks
+#
+# The passwords used in these options must match the passwords used when generating
+# the keystore and truststore. For instructions on generating these files, see:
+# http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore
+#
+server_encryption_options:
+ internode_encryption: none
+ keystore: conf/keystore
+ keystore_password: cassandra
+ truststore: conf/.truststore
+ truststore_password: cassandra
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+ # require_client_auth: false
+ # require_endpoint_verification: false
+
+# enable or disable client/server encryption.
+client_encryption_options:
+ enabled: true
+ # If enabled and optional is set to true encrypted and unencrypted connections are handled.
+ optional: false
+ keystore: /etc/cassandra/keystore.p12
+ keystore_password: "cassandra"
+ require_client_auth: true
+ truststore: /etc/cassandra/truststore.p12
+ truststore_password: "cassandra"
+ store_type: PKCS12
+ # More advanced defaults below:
+ # protocol: TLS
+ # algorithm: SunX509
+ # store_type: JKS
+ # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA]
+
+# internode_compression controls whether traffic between nodes is
+# compressed.
+# Can be:
+#
+# all
+# all traffic is compressed
+#
+# dc
+# traffic between different datacenters is compressed
+#
+# none
+# nothing is compressed.
+internode_compression: dc
+
+# Enable or disable tcp_nodelay for inter-dc communication.
+# Disabling it will result in larger (but fewer) network packets being sent,
+# reducing overhead from the TCP protocol itself, at the cost of increasing
+# latency if you block for cross-datacenter responses.
+inter_dc_tcp_nodelay: false
+
+# TTL for different trace types used during logging of the repair process.
+tracetype_query_ttl: 86400
+tracetype_repair_ttl: 604800
+
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+# This threshold can be adjusted to minimize logging if necessary
+# gc_log_threshold_in_ms: 200
+
+# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
+# INFO level
+# UDFs (user defined functions) are disabled by default.
+# As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
+enable_user_defined_functions: false
+
+# Enables scripted UDFs (JavaScript UDFs).
+# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
+# This option has no effect, if enable_user_defined_functions is false.
+enable_scripted_user_defined_functions: false
+
+# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
+# Lowering this value on Windows can provide much tighter latency and better throughput, however
+# some virtualized environments may see a negative performance impact from changing this setting
+# below their system default. The sysinternals 'clockres' tool can confirm your system's default
+# setting.
+windows_timer_interval: 1
+
+
+# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
+# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
+# the "key_alias" is the only key that will be used for encrypt opertaions; previously used keys
+# can still (and should!) be in the keystore and will be used on decrypt operations
+# (to handle the case of key rotation).
+#
+# It is strongly recommended to download and install Java Cryptography Extension (JCE)
+# Unlimited Strength Jurisdiction Policy Files for your version of the JDK.
+# (current link: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html)
+#
+# Currently, only the following file types are supported for transparent data encryption, although
+# more are coming in future cassandra releases: commitlog, hints
+transparent_data_encryption_options:
+ enabled: false
+ chunk_length_kb: 64
+ cipher: AES/CBC/PKCS5Padding
+ key_alias: testing:1
+ # CBC IV length for AES needs to be 16 bytes (which is also the default size)
+ # iv_length: 16
+ key_provider:
+ - class_name: org.apache.cassandra.security.JKSKeyProvider
+ parameters:
+ - keystore: conf/keystore
+ keystore_password: cassandra
+ store_type: JCEKS
+ key_password: cassandra
+
+
+#####################
+# SAFETY THRESHOLDS #
+#####################
+
+# When executing a scan, within or across a partition, we need to keep the
+# tombstones seen in memory so we can return them to the coordinator, which
+# will use them to make sure other replicas also know about the deleted rows.
+# With workloads that generate a lot of tombstones, this can cause performance
+# problems and even exaust the server heap.
+# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
+# Adjust the thresholds here if you understand the dangers and want to
+# scan more tombstones anyway. These thresholds may also be adjusted at runtime
+# using the StorageService mbean.
+tombstone_warn_threshold: 1000
+tombstone_failure_threshold: 100000
+
+# Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
+# Caution should be taken on increasing the size of this threshold as it can lead to node instability.
+batch_size_warn_threshold_in_kb: 5
+
+# Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
+batch_size_fail_threshold_in_kb: 50
+
+# Log WARN on any batches not of type LOGGED than span across more partitions than this limit
+unlogged_batch_across_partitions_warn_threshold: 10
+
+# Log a warning when compacting partitions larger than this value
+compaction_large_partition_warning_threshold_mb: 100
+
+# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# Adjust the threshold based on your application throughput requirement
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+gc_warn_threshold_in_ms: 1000
+
+# Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
+# early. Any value size larger than this threshold will result into marking an SSTable
+# as corrupted. This should be positive and less than 2048.
+# max_value_size_in_mb: 256
+
+# Back-pressure settings #
+# If enabled, the coordinator will apply the back-pressure strategy specified below to each mutation
+# sent to replicas, with the aim of reducing pressure on overloaded replicas.
+back_pressure_enabled: false
+# The back-pressure strategy applied.
+# The default implementation, RateBasedBackPressure, takes three arguments:
+# high ratio, factor, and flow type, and uses the ratio between incoming mutation responses and outgoing mutation requests.
+# If below high ratio, outgoing mutations are rate limited according to the incoming rate decreased by the given factor;
+# if above high ratio, the rate limiting is increased by the given factor;
+# such factor is usually best configured between 1 and 10, use larger values for a faster recovery
+# at the expense of potentially more dropped mutations;
+# the rate limiting is applied according to the flow type: if FAST, it's rate limited at the speed of the fastest replica,
+# if SLOW at the speed of the slowest one.
+# New strategies can be added. Implementors need to implement org.apache.cassandra.net.BackpressureStrategy and
+# provide a public constructor accepting a Map.
+back_pressure_strategy:
+ - class_name: org.apache.cassandra.net.RateBasedBackPressure
+ parameters:
+ - high_ratio: 0.90
+ factor: 5
+ flow: FAST
+
+# Coalescing Strategies #
+# Coalescing multiples messages turns out to significantly boost message processing throughput (think doubling or more).
+# On bare metal, the floor for packet processing throughput is high enough that many applications won't notice, but in
+# virtualized environments, the point at which an application can be bound by network packet processing can be
+# surprisingly low compared to the throughput of task processing that is possible inside a VM. It's not that bare metal
+# doesn't benefit from coalescing messages, it's that the number of packets a bare metal network interface can process
+# is sufficient for many applications such that no load starvation is experienced even without coalescing.
+# There are other benefits to coalescing network messages that are harder to isolate with a simple metric like messages
+# per second. By coalescing multiple tasks together, a network thread can process multiple messages for the cost of one
+# trip to read from a socket, and all the task submission work can be done at the same time reducing context switching
+# and increasing cache friendliness of network message processing.
+# See CASSANDRA-8692 for details.
+
+# Strategy to use for coalescing messages in OutboundTcpConnection.
+# Can be fixed, movingaverage, timehorizon, disabled (default).
+# You can also specify a subclass of CoalescingStrategies.CoalescingStrategy by name.
+# otc_coalescing_strategy: DISABLED
+
+# How many microseconds to wait for coalescing. For fixed strategy this is the amount of time after the first
+# message is received before it will be sent with any accompanying messages. For moving average this is the
+# maximum amount of time that will be waited as well as the interval at which messages must arrive on average
+# for coalescing to be enabled.
+# otc_coalescing_window_us: 200
+
+# Do not try to coalesce messages if we already got that many messages. This should be more than 2 and less than 128.
+# otc_coalescing_enough_coalesced_messages: 8
+
+# How many milliseconds to wait between two expiration runs on the backlog (queue) of the OutboundTcpConnection.
+# Expiration is done if messages are piling up in the backlog. Droppable messages are expired to free the memory
+# taken by expired messages. The interval should be between 0 and 1000, and in most installations the default value
+# will be appropriate. A smaller value could potentially expire messages slightly sooner at the expense of more CPU
+# time and queue contention while iterating the backlog of messages.
+# An interval of 0 disables any wait time, which is the behavior of former Cassandra versions.
+#
+# otc_backlog_expiration_interval_ms: 200
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12 b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12
new file mode 100644
index 00000000000..501e25cf967
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/keystore.p12 differ
diff --git a/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12 b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12
new file mode 100644
index 00000000000..57107fc3813
Binary files /dev/null and b/modules/cassandra/src/test/resources/cassandra-ssl-configuration/truststore.p12 differ
diff --git a/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml b/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
index 5b57b2a8e58..426dea64771 100644
--- a/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
+++ b/modules/cassandra/src/test/resources/cassandra-test-configuration-example/cassandra.yaml
@@ -250,7 +250,7 @@ commit_failure_policy: stop
#
# Valid values are either "auto" (omitting the value) or a value greater 0.
#
-# Note that specifying a too large value will result in long running GCs and possbily
+# Note that specifying a too large value will result in long running GCs and possibly
# out-of-memory errors. Keep the value at a small fraction of the heap.
#
# If you constantly see "prepared statements discarded in the last minute because
@@ -259,7 +259,7 @@ commit_failure_policy: stop
# i.e. use bind markers for variable parts.
#
# Do only change the default value, if you really have more prepared statements than
-# fit in the cache. In most cases it is not neccessary to change this value.
+# fit in the cache. In most cases it is not necessary to change this value.
# Constantly re-preparing statements is a performance penalty.
#
# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
@@ -309,7 +309,7 @@ key_cache_save_period: 14400
# Fully off-heap row cache implementation (default).
#
# org.apache.cassandra.cache.SerializingCacheProvider
-# This is the row cache implementation availabile
+# This is the row cache implementation available
# in previous releases of Cassandra.
# row_cache_class_name: org.apache.cassandra.cache.OHCProvider
@@ -444,7 +444,7 @@ concurrent_counter_writes: 32
concurrent_materialized_view_writes: 32
# Maximum memory to use for sstable chunk cache and buffer pooling.
-# 32MB of this are reserved for pooling buffers, the rest is used as an
+# 32MB of this are reserved for pooling buffers, the rest is used as a
# cache that holds uncompressed sstable chunks.
# Defaults to the smaller of 1/4 of heap or 512MB. This pool is allocated off-heap,
# so is in addition to the memory allocated for heap. The cache also has on-heap
@@ -553,7 +553,7 @@ memtable_allocation_type: heap_buffers
# new space for cdc-tracked tables has been made available. Default to 250ms
# cdc_free_space_check_interval_ms: 250
-# A fixed memory pool size in MB for for SSTable index summaries. If left
+# A fixed memory pool size in MB for SSTable index summaries. If left
# empty, this will default to 5% of the heap size. If the memory usage of
# all index summaries exceeds this limit, SSTables with low read rates will
# shrink their index summaries in order to meet this limit. However, this
@@ -778,7 +778,7 @@ auto_snapshot: true
# number of rows per partition. The competing goals are these:
#
# - a smaller granularity means more index entries are generated
-# and looking up rows withing the partition by collation column
+# and looking up rows within the partition by collation column
# is faster
# - but, Cassandra will keep the collation index in memory for hot
# rows (as part of the key cache), so a larger granularity means
@@ -1109,7 +1109,7 @@ windows_timer_interval: 1
# Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
# a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
-# the "key_alias" is the only key that will be used for encrypt opertaions; previously used keys
+# the "key_alias" is the only key that will be used for encrypt operations; previously used keys
# can still (and should!) be in the keystore and will be used on decrypt operations
# (to handle the case of key rotation).
#
@@ -1143,7 +1143,7 @@ transparent_data_encryption_options:
# tombstones seen in memory so we can return them to the coordinator, which
# will use them to make sure other replicas also know about the deleted rows.
# With workloads that generate a lot of tombstones, this can cause performance
-# problems and even exaust the server heap.
+# problems and even exhaust the server heap.
# (http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets)
# Adjust the thresholds here if you understand the dangers and want to
# scan more tombstones anyway. These thresholds may also be adjusted at runtime
diff --git a/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem b/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem
new file mode 100644
index 00000000000..bafaa00317b
--- /dev/null
+++ b/modules/cassandra/src/test/resources/client-ssl/cassandra.cer.pem
@@ -0,0 +1,26 @@
+Bag Attributes
+ friendlyName: localhost
+ localKeyID: 54 69 6D 65 20 31 37 32 39 33 34 38 39 36 38 31 31 39
+subject=C = None, L = None, O = Testcontainers, OU = Testcontainers, CN = localhost
+issuer=C = None, L = None, O = Testcontainers, OU = Testcontainers, CN = localhost
+-----BEGIN CERTIFICATE-----
+MIIDbjCCAlagAwIBAgIJAKCVIipuH03/MA0GCSqGSIb3DQEBCwUAMGQxDTALBgNV
+BAYTBE5vbmUxDTALBgNVBAcTBE5vbmUxFzAVBgNVBAoTDlRlc3Rjb250YWluZXJz
+MRcwFQYDVQQLEw5UZXN0Y29udGFpbmVyczESMBAGA1UEAxMJbG9jYWxob3N0MCAX
+DTI0MTAxOTE0NDIwOFoYDzIxMjQwOTI1MTQ0MjA4WjBkMQ0wCwYDVQQGEwROb25l
+MQ0wCwYDVQQHEwROb25lMRcwFQYDVQQKEw5UZXN0Y29udGFpbmVyczEXMBUGA1UE
+CxMOVGVzdGNvbnRhaW5lcnMxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBALocrhrM1gYB/pF/qlDY+eFQZ9L8SMgCmn+I
+mgx/UbKqJwLp5wYuoW/PA4RwraFPkimf5CAE2kpBGcJu/Qzyp0fJZlBXpmkDJVrG
+pRbYz5mN4CrXNliYfAC1RzxvTT1tOjiDkk9kHVfs5nMVb9e2kq6tQEItflhlPzdD
+FOe0pY2XBX2stcQ6URRkK5buyPeLhnTrKMfLWEWKKKzSQGen+lbtBURZzkpmK88q
+qjLqqaZusXP6QlRVLqMADjQf7aXLi0A/fIhVrq1amqqiApJbijT0LP48DvS8DQQL
+jNKkQ17vMClMmXusU5IgJMlXfGEzeTNUI56wHGYUdE69FTGFvZECAwEAAaMhMB8w
+HQYDVR0OBBYEFNsvIE+IgkE0aTc+1MI7hpPQL2ZEMA0GCSqGSIb3DQEBCwUAA4IB
+AQC4U/tGPuRS3m/r1p3aAq0D88UGg6oKHwqe3re3xrFAv9y+Y3M+FXyh5w/yMCAr
+PcVo6Pef3hEjwc9wDuQoIcQ9eRZtYI1RnhkkuC8TZRk1KGKg9Lj4Zzbse7FfK92Z
+DUYgIVyhC/YkeEDwTiZI8WxhbglozNg5Ygw+qLK4rYmk+X/NgdfdQHocuJ3Jwqqx
+eYz0m2RUMhzxEI2z9jQr3DgjNkYrphLzaVXmO4MovzXx3DNeC8ADot9PGmaz24rl
+RDeSWynxbgqzdXGHxtyR0LY1k+Y+5wqU28L90D0o3ZtaMBnK+Ft2AP2zpbtgr8rR
+sf12uPyRUPzJQ46KNpjy4HN6
+-----END CERTIFICATE-----
diff --git a/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem b/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem
new file mode 100644
index 00000000000..4d291cf8852
--- /dev/null
+++ b/modules/cassandra/src/test/resources/client-ssl/cassandra.key.pem
@@ -0,0 +1,32 @@
+Bag Attributes
+ friendlyName: localhost
+ localKeyID: 54 69 6D 65 20 31 37 32 39 33 34 38 39 36 38 31 31 39
+Key Attributes:
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC6HK4azNYGAf6R
+f6pQ2PnhUGfS/EjIApp/iJoMf1GyqicC6ecGLqFvzwOEcK2hT5Ipn+QgBNpKQRnC
+bv0M8qdHyWZQV6ZpAyVaxqUW2M+ZjeAq1zZYmHwAtUc8b009bTo4g5JPZB1X7OZz
+FW/XtpKurUBCLX5YZT83QxTntKWNlwV9rLXEOlEUZCuW7sj3i4Z06yjHy1hFiiis
+0kBnp/pW7QVEWc5KZivPKqoy6qmmbrFz+kJUVS6jAA40H+2ly4tAP3yIVa6tWpqq
+ogKSW4o09Cz+PA70vA0EC4zSpENe7zApTJl7rFOSICTJV3xhM3kzVCOesBxmFHRO
+vRUxhb2RAgMBAAECggEACqD5e7C+Rr8oz+jS/z8FAxsmcsqgFXW6NEjG4EPWx89a
+RWfthVFDov3XNsizzp/OulXWH2xnhkOyU7cm+Ia7JI+Z9w8Qz+dM5AkVA8Y23o9X
+TnSjNx57DODnEP21eZAzxpp50DlPFU02pzsbYhE2AbsFp0HirB9MI70CN24xR9hP
+i1zPgO7FVnLvn4INqVKgcV4vXlxvgDEvO4Myc1WoJXkyPCCObvEflBBWr2QwQfKT
+T2qjCJWv/P2PJGFaZbOrEvOHZjprSid4/n9gbQrodGoChhjiZT//l19Ay+7eJkUc
+yiiSK4u3fF4YPH9+CVpRQ94PHFe+0kQVvf+VGX/iqQKBgQDp5umTcZoho/KQzOd/
+pA8fgnzbipEl5ep2MHB98cqEQ93eFv4l/bBehDQ1WvmFJY8SIzU4EQotpnCZd4Vb
+KH9PE8tsTRvw2cYbBuD751boLVaBn8wxtlTkFrN/CyAtV7w7AG0dXnDKushJx1NN
+8AgvSr0X4hf0AKIWGtVteoX7qwKBgQDLse7Ze5dNbG48CpBGqQS4wFkTSEs5QKI5
+68JXEQoCmJb06O7rxj4f5CALv3pReP3nrl5+kLmT8O+yU5C5dXf06k/z4GDJ6Esm
+8XTEfB2Ca+kI2RLyMRRXPA2nEunbSsyk1AVo2GeRJxG4TaDbu2zTkUBAEyCuwarW
+OMsuYodPswKBgQCZc/kB1qH8OAdHoGawgv24+m7Xycz4RCLSb20d86edprjEn+kV
+G56+I5Xs+0aAZ+e5Sof7xJIc6Pkudg9zgtojEyV+ZAhUt0sVKCoqmdeWc0gxupjI
+dIq1KX+RdccieFDxlJIBlpgBKRGF9dNdaoC0JiBwrtBwMIomXmxvatbECQKBgQCS
+X1xZn/xLwJ0+PAENJauk72OS/aJAk/d/U7ElS7M7xlbDyxbVCnHeDNoSVxgYr68U
+6zIwFOOmMb6tEGuxOX5n2nB1uUkUDf7jDyNvhhjWfaDJoOOCck5BmX/eDTNLR+bi
+kxEIFGnn3oFXRUFQZNCA/6GB6bzUl4qhwdIPlPHTDQKBgQCgztlUF5IOJFKMjVlY
+yoA/7+b5zwrh8Y2+SLzF/HLah85AuHxsgdTuQh+HLKSwJejKCT95BSRJO/kV0XCR
+KZGStqETpEH/2AJkxpjt0FZxtIQdnyTargbiipe4JzI3iCTLtfN5C9Pn3ZJ9giap
+B5uQm4762aH2jw1kKFegHlIgJg==
+-----END PRIVATE KEY-----
diff --git a/modules/cassandra/src/test/resources/initial-with-error.cql b/modules/cassandra/src/test/resources/initial-with-error.cql
new file mode 100644
index 00000000000..4f0e11d721b
--- /dev/null
+++ b/modules/cassandra/src/test/resources/initial-with-error.cql
@@ -0,0 +1,6 @@
+CREATE KEYSPACE keySpaceTest WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
+
+USE keySpaceTest;
+
+/* The following statement contains an error (missing primary key) on purpose, do not fix it! */
+CREATE TABLE catalog_category (id bigint);
diff --git a/modules/chromadb/build.gradle b/modules/chromadb/build.gradle
new file mode 100644
index 00000000000..ec41def56df
--- /dev/null
+++ b/modules/chromadb/build.gradle
@@ -0,0 +1,7 @@
+description = "Testcontainers :: ChromaDB"
+
+dependencies {
+ api project(':testcontainers')
+
+ testImplementation 'io.rest-assured:rest-assured:5.5.7'
+}
diff --git a/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java b/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java
new file mode 100644
index 00000000000..af6c3df33fc
--- /dev/null
+++ b/modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java
@@ -0,0 +1,56 @@
+package org.testcontainers.chromadb;
+
+import lombok.extern.slf4j.Slf4j;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.ComparableVersion;
+import org.testcontainers.utility.DockerImageName;
+
+/**
+ * Testcontainers implementation of ChromaDB.
+ *