This project is a runnable reference for QA/SRE/load-test teams who want to validate SMS delivery at scale using MailSlurp deliverability tests.
It includes two JMeter approaches:
- HTTP Sampler approach (classic JMeter style): explicit REST calls and JSON extractors.
- Java Request approach (JMeter pro style): Java sampler using
mailslurp-client-java:17.1.0+ API client calls.
Both approaches support:
runType=ALLrunType=SINGLEsendMode=SIMULATOR|EXTERNAL- poll every 15s
- 20-minute poll timeout by default
End-to-end flow:
- Read
API_KEY(or-JapiKey=...). GET /phone/numbersand select phones.- Select one phone as the simulation sender.
- Create deliverability test (
POST /test/deliverability) with scopePHONE. - Exclude the simulation sender from targets.
- Start test (
POST /test/deliverability/{testId}/start). - If
sendMode=SIMULATOR, create simulation job (POST /test/deliverability/{testId}/simulation-jobs). - Poll status (
GET /test/deliverability/{testId}/status) until done/fail/timeout. - Emit final pass/fail result for CI.
Some telecom routes can allow self-delivery/loopback behavior. We explicitly exclude the sender phone from target selection to keep results clean and deterministic.
- Selector:
type=ALL - Targets: all phones in scope
- Excludes: simulation sender phone ID
- Uses first page of phones from
/phone/numbers content[0]= simulation sendercontent[1]= single explicit target- Selector:
type=EXPLICIT,entityIds=[content[1].id] - Excludes:
excludeEntityIds=[content[0].id]
SINGLE requires at least 2 phone numbers.
This example creates a MailSlurp simulation job to generate SMS sends automatically.
Simulation call is skipped. Use this when you want your own system-under-test to send SMS while MailSlurp deliverability test tracks outcomes.
- HTTP plan:
java-jmeter-sms-deliverability-loadtest/src/test/jmeter/basic-smoke.jmx - Java sampler plan:
java-jmeter-sms-deliverability-loadtest/src/test/jmeter/basic-smoke-java-sdk.jmx - Java sampler class:
java-jmeter-sms-deliverability-loadtest/src/main/java/com/example/jmeter/MailSlurpDeliverabilityJavaSampler.java - Maven module:
java-jmeter-sms-deliverability-loadtest - Local OpenAPI source:
api-docs.json - Long-form guide/blog:
BLOG-SMS-DELIVERABILITY-JMETER.md
- Java 17+
- Maven 3.9+
- MailSlurp API key
- At least 1 phone number (
ALL) or 2+ (SINGLE)
Set your key:
export API_KEY='your_mailslurp_api_key'make test-http-all
make test-http-singlemake test-java-all
make test-java-singlemake test
make test-all
make test-singleJMeter is auto-downloaded to opt/ on first GUI run.
make gui # HTTP plan
make gui-single # HTTP + runType=SINGLE
make gui-java # Java sampler plan
make gui-java-single # Java sampler + runType=SINGLEList all commands:
make helpMost used:
make test-http-allmake test-http-singlemake test-java-allmake test-java-singlemake report-httpmake report-javamake logs-tailmake logs-tail-java
Optional runtime override:
API_KEY=... SEND_MODE=EXTERNAL make test-java-singleHTTP approach prints:
JMETER_SETUP ...JMETER_PROGRESS ...JMETER_FINAL ...
Java approach prints:
JMETER_JAVA_SETUP ...JMETER_JAVA_PROGRESS ...JMETER_JAVA_FINAL ...JMETER_JAVA_ERROR ...
- HTTP log:
java-jmeter-sms-deliverability-loadtest/target/jmeter/logs/basic-smoke.jmx.log - Java log:
java-jmeter-sms-deliverability-loadtest/target/jmeter/logs/basic-smoke-java-sdk.jmx.log
- HTTP:
java-jmeter-sms-deliverability-loadtest/target/jmeter/results/*-basic-smoke.csv - Java:
java-jmeter-sms-deliverability-loadtest/target/jmeter/results/*-basic-smoke-java-sdk.csv
make report-http
make report-javaOutputs:
java-jmeter-sms-deliverability-loadtest/target/jmeter/report/basic-smoke/index.htmljava-jmeter-sms-deliverability-loadtest/target/jmeter/report/basic-smoke-java-sdk/index.html
- Single-thread reference flow for clarity and reproducibility.
- Explicit phase naming (
1),2), ...). - Preflight validation for API key and mode parameters.
- 2xx assertions on API calls.
- JSON extraction + strict ID validation.
- Poll-loop with deterministic timeout gates.
- CI-safe final pass/fail sampler.
- Section comments directly in JMX XML for source readability.
- Distinct console markers for setup/progress/final status.
Use:
make logs-tail
make logs-tail-javaThe Makefile auto-selects Java 21/17 on macOS for JMeter runs. You can also force:
API_KEY=... JAVA_COMPAT_HOME=$(/usr/libexec/java_home -v 21) make test-singleConfirm run actually used runType=SINGLE and check setup log lines:
- HTTP:
JMETER_SETUP runType=SINGLE simulationPhoneId=... targetPhoneId=... - Java:
JMETER_JAVA_SETUP phoneCount=... runType=SINGLE simulationPhoneId=... targetPhoneId=...
You must have at least 2 phones in the account.
Set sendMode=EXTERNAL and trigger your platform's SMS sender after test start.
You still get MailSlurp deliverability status/progress tracking and deterministic polling without fragile inbox waitFor patterns.
- Deliverability tests: https://docs.mailslurp.com/deliverability-test/
- API docs (OpenAPI): https://api.mailslurp.com/v2/api-docs
- SMS/email deliverability load testing guide: https://www.mailslurp.com/guides/email-and-sms-deliverability-load-testing/