Chapter 17Lesson 04~190 minutes

JMS, FTP, LDAP, TCP, and Other Protocol Test Patterns: Diagnostics, Failure Modes, and Production Practices

Protocol errors often look like “timeout” even when the target is healthy. The most important diagnostic question is what lifecycle boundary the sampler was waiting for: socket framing, connection establishment, broker reply, FTP login/data transfer, LDAP bind/search, provider class loading, or downstream processing.

Framing failureProvider JARQueue cleanupSecurityCausal diagnosis

Learning objectives

  • Reject the assumption that every sampler behaves like HTTP request/response.
  • Diagnose TCP framing/timeouts without masking the cause.
  • Recognize missing JMS provider JARs and identifier collisions as generator/configuration problems.
  • Prevent queue/file/directory state accumulation.
  • Reject corporate/prod protocol targets and TLS/auth weakening.
  • Distinguish send-side timing from end-to-end processing.

1. Preserve first-failure evidence

All runnable failure reproduction stays on 127.0.0.1:9100, ≤2 threads. Preserve failed JMX, exact TCP config/framing fields, payload/request ID, JTL + jmeter.log, fixture event log, generator sockets/CPU, and CLI before changing the plan. Do not erase timeout evidence after repair.

2. Protocol diagnostic sequence

Non-HTTP protocol diagnostic sequence

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
E[Preserve JTL + jmeter.log + server/provider evidence] --> V[Confirm JMeter / Java / provider/plugin versions]
V --> C[Confirm exact JMX/data/properties/CLI + authorized target]
C --> S[Inspect sampler/config scope + resolved variables]
S --> P[Inspect protocol connection/session/framing/message/file state]
P --> G[Inspect generator JVM/OS/network/provider classpath]
G --> T[Inspect target queue/files/sessions/workers/telemetry]
T --> X[Inspect distributed/CI/container state if relevant]
X --> F[Least destructive correction]
F --> R[Small controlled rerun]

3. Failure mode: treating all samplers like HTTP

HTTP has status codes, headers, content length, standardized connection semantics, and widely understood request/response boundaries. Raw TCP may have none of these. JMS send success may not mean consumer completion. FTP login latency is a special metric. LDAP sessions require bind state.

Repair the mental model first: define what constitutes request completion, response completion, acknowledgement, cleanup, and target success for the selected protocol.

4. Intentionally broken TCP example: reuse=true but EOL omitted

Broken settings:

Setting Broken value
TCPClient TCPClientImpl
Re-use connection true
Server keeps socket open yes
Response EOL byte unset / skipped
Response Timeout 500 ms

The server sends a line ending in LF but leaves the persistent socket open. Without EOL, TCPClientImpl reads until input stream end. Because the connection intentionally stays open, JMeter waits until timeout.

The fixture event log may already show that the request was parsed and the reply was written quickly. This proves target work happened even though the JMeter sample timed out waiting for its own response boundary.

Repair: preserve the failed run, set EOL byte to 10, keep the same request/server/thread count, rerun. Do not add a long timeout as the “fix.”

5. Failure mode: JMS provider JAR unavailable

Symptoms can include class/JNDI factory not found or provider initialization errors before useful broker traffic. JMeter does not bundle a JMS implementation JAR.

Repair: pin the authorized broker's provider/client version, place the required provider and dependency JARs in JMeter lib on every injector, restart, and verify classpath/JNDI setup with one thread. Do not blame broker saturation for a classpath error.

6. Failure mode: targeting corporate LDAP/JMS/FTP

Access credentials or endpoint knowledge do not grant permission to generate load. LDAP can affect shared authentication; JMS can accumulate/consume business messages; FTP uploads can overwrite files.

Use a local/disposable fixture or an explicitly authorized performance environment with synthetic accounts/data and cleanup ownership.

7. Failure mode: message or file accumulation

JMS Request Only with no consumer can grow queue depth indefinitely. FTP PUT loops can leave thousands of files. Directory Add tests can leave entries if cleanup is not automatic/user-defined.

Before each run, predict state delta; during run, monitor bounded queue/file/entry counts; after run, clean only run-scoped synthetic state and independently verify zero leftovers.

8. Failure mode: shared queue/client/correlation identifiers

Multiple JMS threads can collide when they reuse one durable Client ID or ambiguous reply selector/correlation ID. Responses may be consumed by the wrong virtual user.

Use thread/run-unique client IDs, correlation IDs, destinations/selectors as required by the provider and architecture. Do not store one mutable correlation ID in a JMeter global property.

9. Failure mode: disabling TLS/authentication checks

Raw TCP/FTP/LDAP/JMS provider errors can tempt testers to turn off certificate verification, anonymous-bind unexpectedly, or disable broker authentication. That changes the security/protocol path and can invalidate the workload.

Fix certificates/trust/auth/provider configuration in the authorized environment. The mandatory TCP fixture intentionally needs none of these.

10. Failure mode: one-way send reported as end-to-end processing

JMS Request Only can complete when the provider accepted/sent the message while consumers are backlogged. A low send p95 therefore cannot be labeled “order processing p95.”

Use Request Response when a reply represents completion, or pair one-way send with server-side processing timestamps/correlation and queue-lag telemetry.

11. Failure mode: FTP latency mistaken for total transfer time

JMeter defines FTP sampler latency as login time. If the file is 1 GiB, login can be fast while total elapsed is large. Report login latency and total transfer elapsed/throughput separately if both matter.

12. Failure mode: LDAP bind semantics misunderstood

Current LDAP Extended documentation notes that no password can start an anonymous session, whereas a wrong password fails. A test can therefore “work” anonymously when the intended authenticated path was not exercised.

Assert the expected directory identity/access behavior and use explicit fake credentials in a local authorized directory.

13. Causal symptom table

Symptom Generator/protocol cause Target cause to distinguish Evidence
TCP timeout; server logged fast reply missing framing/EOL slow service JTL timeout + server service time + socket still open.
JMS class/JNDI error provider JAR/classpath config broker saturation jmeter.log + no broker connection.
JMS send fast; queue depth climbs request-only + consumer lag producer/broker ingress issue JTL send + queue depth/consumer timing.
FTP high elapsed, low latency large transfer/local disk slow login/auth latency vs elapsed + file size/server timing.
LDAP errors across threads shared DN/session/scope or bind issue directory saturation bind/session result + directory metrics.
CI-only protocol failure missing JAR/file/port/container startup service regression CI classpath/files/logs + target telemetry.

14. Troubleshooting shortcuts to reject

  • Do not add blanket retries or arbitrary long sleeps around protocol failures.
  • Do not grow threads/messages/files while cleanup/correlation is unresolved.
  • Do not disable TLS/RMI/auth checks.
  • Do not move per-user connection/correlation state into global properties.
  • Do not grant broad directory/broker/file permissions for convenience.
  • Do not delete failed JTL/jmeter.log/target evidence.
  • Do not install random plugins/provider JAR versions without compatibility provenance.

Knowledge check

Why does TCP reuse=true without EOL cause timeout against a server that already replied?

What proves a missing JMS class is not broker saturation?

Why can Request Only p95 be misleading?

What is wrong with a single durable Client ID across many JMS threads?

Why is an LDAP anonymous bind a validity risk?

Next lesson

Checkpoint: connection lifecycle is part of the result

Lesson 5 predicts and verifies persistent versus per-sample TCP connection demand, request/reply delay, framed response correctness, target cleanup, and a second-protocol JMS architecture design.

Official references and version notes

Version and compatibility note

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.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.