JMS, FTP, LDAP, TCP, and Other Protocol Test Patterns: Core Concepts and Mental Model
Chapters 5–16 established a recurring rule: the sampler is only one layer of a performance experiment. Moving beyond HTTP makes that rule even more important. A TCP request needs a framing rule; a JMS send needs destination, provider, acknowledgement/reply semantics; FTP has login plus data transfer; LDAP has bind/session and directory-operation semantics. Copying HTTP assumptions across these protocols can produce technically successful but scientifically invalid tests.
Learning objectives
- Explain why each JMeter protocol family has distinct connection/session/message/file/directory semantics.
- Identify built-in samplers versus external provider/client dependencies.
- Distinguish request/reply timing from one-way send timing.
- Define framing, acknowledgement, queue/file cleanup, credentials, and measurement boundaries before load.
- Inspect protocol/server state non-destructively before changing the test.
- Recognize direct protocol tests as specialized experiments rather than automatic end-user capacity tests.
1. The practical problem: “non-HTTP” is not one workload type
JMeter can drive several protocol families, but a “sample” means different work depending on the protocol. FTP's login phase and file transfer are distinct. TCP has no universal application-message boundary; the client must know where one reply ends. JMS can publish without waiting for business processing, or can wait for a reply queue. LDAP operations occur inside a bind/session model.
127.0.0.1:9100, maximum 2 threads, finite loops,
synthetic payloads, and ≤100 ms server-side synthetic delay.
JMS/FTP/LDAP are taught as architecture/configuration exercises
unless the learner separately provisions an authorized local
fixture.
2. Mental model: protocol configuration → client → target → protocol-specific evidence
Each protocol family defines its own client dependency, session/connection lifecycle, payload framing or acknowledgement rules, and what a sampler elapsed time actually means.
flowchart TD W[Threads / pacing / data] --> C[Protocol config + client/provider dependency] C --> S[JMeter protocol sampler] S --> T[Local broker / TCP server / FTP server / LDAP directory] T --> R[Reply / message / file / LDAP result] R --> A[Protocol-aware assertion] S --> J[JTL + jmeter.log] T --> E[Server queue/file/session/event telemetry] G[Generator CPU / GC / sockets / provider JARs] --> V[Validity review] J --> V E --> V
Workload configuration determines how often the sampler acts. The
protocol configuration layer defines host/port, framing,
JNDI/provider libraries, credentials, destinations, or directory
defaults. The sampler uses a client implementation to communicate
with the target. The target returns a reply/message/file/directory
result whose meaning is protocol-specific. JTL and
jmeter.log capture the generator-side result; server
queue/file/session/event evidence independently proves target state
and cleanup. Generator provider/classpath/socket state is a separate
validity boundary.
3. TCP: connection lifecycle and message framing
The built-in TCP Sampler opens a TCP/IP connection, sends text/binary data, and waits for a response. With Re-use connection enabled, samplers in the same JMeter thread can reuse a socket only when the exact same host string and port are used; different threads use different connections.
TCP itself is a byte stream—not a message protocol.
TCPClientImpl must know when a response ends. The
chapter's line protocol configures EOL byte 10 (LF),
and the request appends LF using ${__char(10)}. Without
framing on a persistent socket, JMeter can wait until response
timeout because the server keeps the stream open.
4. FTP: control/login and file transfer
FTP Request can retrieve or upload a file. Current JMeter documentation sets sampler latency to the FTP login time, while total elapsed includes the broader request/transfer work. Binary versus ASCII mode and whether downloaded bytes are saved in response/local file affect both semantics and generator I/O.
The FTP password field is visible in the test plan. Use only fake/local credentials for labs and an approved secret-injection mechanism in real environments.
5. JMS: provider dependency and messaging semantics
JMeter includes JMS Publisher, Subscriber, and Point-to-Point
samplers, but it does not include a JMS
implementation/provider JAR. You must supply the provider-specific
client/JNDI libraries in JMETER_HOME/lib and restart
JMeter.
Message semantics matter: request-only sends to a queue and does not wait for business completion; request-reply waits for a reply and can represent service response time. Subscriber behavior also differs between a receive-based consumer and a listener that remains active after the sample.
6. LDAP: operations inside a directory session
The basic LDAP sampler can Add, Modify, Delete, or Search. LDAP Extended can model the session more explicitly; current documentation starts from a thread bind because LDAP requests are part of a session. A search latency/result is therefore not automatically comparable with a one-off HTTP GET.
Corporate directory systems are especially sensitive targets. The mandatory chapter never binds to an enterprise directory.
7. State to define before changing a protocol test
| State | Examples/questions |
|---|---|
| Generator | JMeter/Java version; provider/client JARs; CPU/GC; socket/file I/O; listeners? |
| Thread/arrival | Threads, loops, pacing, configured versus achieved sends/requests/replies? |
| Component scope | TCP Sampler Config, FTP Defaults, LDAP Defaults, JMS JNDI/provider fields? |
| Variables/data | Request ID, queue name, filename, LDAP DN/filter, TCP payload, correlation ID? |
| Protocol/session | TCP socket/framing; JMS connection/session/ack/reply; FTP login/control/data; LDAP bind? |
| Target | Broker queue depth, files, active sockets, directory entries, service worker state? |
| Credentials/trust | Fake/local credentials; TLS/auth mode; provider truststore; no verification weakening? |
| Artifacts | JTL, jmeter.log, server logs, queue/file cleanup evidence, connection/session IDs? |
| Validity | Does sampler elapsed mean send, request/reply, transfer, or full application processing? |
8. Read-only inspection before traffic
For the mandatory TCP lab, inspect the exact listen address/port, fixture version, event-log path, and existing open connections before JMeter starts. For optional protocols:
- JMS: provider version/JARs, queue/topic names, current queue depth, consumers, durable subscription/client IDs.
- FTP: local fixture root, user permission, expected files, current file hashes/sizes.
- LDAP: local directory base DN, bind account rights, entry count, search-only scope.
Do not use a mutation (clear queue, delete file, modify directory entry) merely to prove connectivity.
9. Result semantics are protocol-specific
| Protocol pattern | What a successful sampler proves | What it does not prove |
|---|---|---|
| TCP request/reply | A framed request was sent and a framed reply arrived before timeout. | Business work outside the reply path completed. |
| JMS request-only | Producer send completed according to provider/client semantics. | Consumer processed/persisted business work end-to-end. |
| JMS request-reply | A correlated reply arrived from the configured reply path. | All downstream asynchronous effects finished. |
| FTP download | Login/transfer completed and bytes were returned/saved. | Application ingestion/processing of that file finished. |
| LDAP search | Bind/session/search operation returned results. | Downstream app using LDAP is healthy/end-to-end fast. |
10. Built-in sampler does not mean dependency-free target
TCP is dependency-free for this lab because Java sockets and
JMeter's built-in TCP client are enough. JMS needs provider
libraries. FTP/LDAP require actual servers with protocol-compatible
accounts and fixtures. A custom binary protocol may need a custom
TCPClient implementation or a plugin/client library.
11. DevOps connection
Production protocol testing should make the client/provider version, connection/session model, message/file/data ownership, cleanup method, security mode, and metric boundary reviewable. Otherwise teams end up comparing “milliseconds” that measure fundamentally different things.
Knowledge check
Why can't TCPClientImpl simply reuse a socket without a framing rule?
TCP is a byte stream; JMeter needs to know where one response ends, such as an explicit EOL byte, or it may wait for stream close/timeout.
Why isn't a JMS request-only sample end-to-end processing latency?
It measures the producer/send path and does not wait for a consumer/business reply.
What does FTP sampler latency represent in current JMeter?
The time taken to log in to the FTP server.
Why can two TCP JMeter threads not automatically share one reused socket?
Current TCP connection reuse is scoped to samplers in the same JMeter thread and same exact host string/port.
Why does JMS need extra JARs even though the sampler is built in?
JMeter provides the sampler integration but does not bundle a JMS provider implementation/client library.
Official references and version notes
- JMeter Component Reference — TCP Sampler — built-in TCP clients, EOL/binary framing, per-thread connection reuse, timeouts, and socket lifecycle.
- JMeter Component Reference — FTP Request — upload/download behavior, login latency, binary/ASCII modes, and credential storage.
- JMeter Component Reference — JMS Publisher — provider/JNDI dependencies, destinations, persistence, message sources, and provider JAR requirements.
- JMeter Component Reference — JMS Subscriber — queue/topic clients, durable IDs, selectors, receive/listener strategies, and connection lifecycle.
- JMeter Component Reference — JMS Point-to-Point — request-only, request-reply, read, browse, and clear semantics.
- JMeter Component Reference — LDAP Request — Add/Modify/Delete/Search operations and cleanup differences.
- JMeter Component Reference — LDAP Extended Request — bind/session-oriented LDAP operations.
- JMeter Functions — __char — inserts explicit Unicode characters such as LF for TCP text framing.
- JMeter Getting Started — Java requirements and GUI authoring versus CLI execution.
- JMeter Best Practices — non-GUI execution and generator validity.
- Apache JMeter downloads — current stable release and Java requirement.
Version-sensitive statements were rechecked against current Apache
JMeter primary documentation on 2026-09-05. The course baseline
remains Apache JMeter 5.6.3 with a Java 17 JDK;
JMeter 5.6.3 requires Java 8+. TCP Sampler is built in and the
mandatory lab uses its default TCPClientImpl with
explicit LF (EOL byte=10) framing. With connection
reuse enabled, TCP connections are reused only by samplers in the
same JMeter thread that use the exact same host string and port;
different threads use different sockets. JMeter's FTP, LDAP/LDAP
Extended, JMS Publisher/Subscriber/Point-to-Point, and TCP
samplers are currently built in. JMS is different from
TCP/FTP/LDAP because JMeter does not bundle a JMS
provider implementation JAR: provider-specific client/JNDI
libraries must be supplied in JMeter's lib directory
and JMeter restarted. FTP sampler latency is the FTP login time,
not full file-transfer elapsed time. JMS request-only measures the
send-side sample; request-reply waits for a reply from the service
and is the appropriate built-in pattern when request-to-reply
latency is required. LDAP Extended models session operations such
as thread bind/unbind. Core TCP login/password fields are not used
by the supplied TCP clients and any entered password is stored
unencrypted, so the TCP lab leaves them blank.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.