- ✅ Docker Compose with TLS-enabled Kafka
- ✅ GitHub Actions CI/CD pipeline
- ✅ Connection pool sizing documentation
# 1. Setup environment
./scripts/generate-tls-certs.sh
docker-compose up -d
# 2. Create topics
docker exec gatling-kafka kafka-topics --create \
--bootstrap-server localhost:9092 \
--topic request_topic --partitions 4 --replication-factor 1
docker exec gatling-kafka kafka-topics --create \
--bootstrap-server localhost:9092 \
--topic response_topic --partitions 4 --replication-factor 1
# 3. Run tests
mvn clean test
# 4. Monitor (optional)
open http://localhost:8080 # Kafka UI- README.md - Complete framework documentation
- DOCKER_SETUP.md - Docker environment guide
- CI Workflow - GitHub Actions pipeline
kafka()
.bootstrapServers("localhost:9092")
.numProducers(1)
.numConsumers(4);kafka()
.bootstrapServers("localhost:9093")
.producerProperties(Map.of(
"security.protocol", "SSL",
SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG,
"./tls-certs/kafka.client.truststore.jks",
SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "kafkatest123"
))
.consumerProperties(Map.of(
"security.protocol", "SSL",
SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG,
"./tls-certs/kafka.client.truststore.jks",
SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "kafkatest123"
));| Service | Endpoint | Credentials |
|---|---|---|
| Kafka (PLAINTEXT) | localhost:9092 | - |
| Kafka (TLS) | localhost:9093 | See tls-certs/ |
| Redis | localhost:6379 | - |
| PostgreSQL | localhost:5432 | gatling/password |
| Kafka UI | http://localhost:8080 | - |
# Unit tests only
mvn test -Dtest='!*IntegrationTest'
# Integration tests (requires Docker)
mvn test -Dtest='*IntegrationTest'
# All tests
mvn verify| Scale | Users/sec | maxTotal |
|---|---|---|
| Small | < 10 | 10-20 |
| Medium | 10-100 | 30-50 |
| Large | 100-500 | 50-100 |
Formula: (Users/sec) × (Duration) × 1.5
| Scale | Concurrent | Pool Size |
|---|---|---|
| Small | < 50/sec | 10-20 |
| Medium | 50-200/sec | 20-40 |
| Large | 200-500/sec | 40-80 |
Formula: (Concurrent) × (Query time) + 5
Kafka won't start?
docker-compose logs kafka
lsof -i :9092 # Check port conflictsTLS errors?
./scripts/generate-tls-certs.sh # RegenerateDatabase connection failed?
docker exec -i gatling-postgres psql -U gatling -d gatling \
< src/main/resources/sql/create_requests_table.sql- Development: Use PLAINTEXT (port 9092)
- Staging/Prod Testing: Use TLS (port 9093)
- Load Tests: Monitor connection pool metrics
- Cleanup:
docker-compose down -vremoves all data
- Documentation: See README.md
- Issues: GitHub Issues
- CI Status:
.github/workflows/ci.yml
Happy Testing! 🚀