Skip to content

JMeter gRPC, Kafka, and MQTT

Test gRPC, Kafka, and MQTT with JMeter via plugins: what core includes, install discipline, plan patterns, observability, and when other tools fit better.

Difficulty
advanced
Guide type
how-to
Estimated read time
11 min read
Last verified version
Verified JMeter 5.6

gRPC / Kafka / MQTT with JMeter (Plugin Ecosystem)

Section titled “gRPC / Kafka / MQTT with JMeter (Plugin Ecosystem)”

Modern systems often speak gRPC, Kafka, or MQTT alongside HTTP. Stock Apache JMeter includes a wide set of protocols (HTTP, JDBC, JMS, LDAP, FTP, mail, and more in the component reference), but gRPC, Kafka, and MQTT clients are not the classic core HTTP-centric story. Teams typically add community plugins or custom samplers. This guide sets honest expectations, install rules, and test-design patterns grounded in JMeter’s extension model and operational best practices.

Useful adjacent core capabilities:

NeedCore approach
HTTP/JSON APIsHTTP Request (API guide)
JMS queues/topicsJMS samplers (JMS plans)
JDBC backendsJDBC Request
Custom TCPJava Request / custom sampler (extending)
Live metricsBackend Listener (guide)

If your “Kafka test” is really “HTTP service that writes to Kafka,” load the HTTP API with core JMeter and monitor Kafka lag separately.

ProtocolTypical JMeter approach
gRPCPlugin sampler using .proto / reflection; or gateway HTTP/JSON if available
KafkaPlugin producer/consumer samplers; or JMS if you use a JMS bridge (different semantics)
MQTTPlugin publisher/subscriber samplers
WebSocketPlugins (WebSocket guide)

Install via Plugins Manager / lib/ext. Identical plugins on all distributed workers.

  1. Bootstrap auth often still uses HTTP (OIDC token) → core HTTP + JWT + correlation.
  2. Stable sampler labels for dashboard/Grafana cardinality.
  3. CLI load: jmeter -n -t ... -l ... (best practices).
  4. Size threads for concurrent streams/producers (Thread Calculator).
  5. Assert business success (not only “socket connected”).
  6. Observe the broker/service (consumer lag, gRPC server metrics), not only JMeter RPS.
  • Direct unary or streaming calls to gRPC services.
  • Teams already invested in JMeter for mixed protocols.
Thread Group
├── HTTP get token (optional)
├── gRPC sampler (plugin): method, metadata, message
├── Assertion / extractor on response payload
└── Timer
  • Protobuf version skew between plugin and server.
  • TLS and metadata (authorization) misconfiguration.
  • Streaming RPCs hold threads longer than unary calls.
  • Reflection vs descriptor files in CI images.

Many orgs use dedicated gRPC load tools or k6/ghz for pure gRPC and keep JMeter for HTTP/JMS. That can be the right split (vs alternatives).

  • Plugin Kafka Producer sampler: topic, key, payload, acks.
  • CSV or functions for keys (\${__UUID}).
  • Measure produce latency and error %.
  • Harder in load tools: consumer lag is a platform metric.
  • Plugin consumers may poll messages; define success clearly (message received vs processing time).
  • Avoid unbounded consume loops without stop conditions.

Kafka is not HTTP: throughput depends on batching, compression, partition count, and broker disks. Align test topics with non-prod clusters and retention policies so you do not flood shared brokers.

Core JMS samplers talk to JMS providers. That is not a drop-in Kafka client even if some stacks bridge protocols. Use the right tool for the wire protocol you mean to stress.

  • Fan-in: many publishers, few topics.
  • Fan-out: few publishers, many subscribers (threads as subscribers).
  • QoS levels change latency and reliability trade-offs; document which QoS you test.
  • Username/password or certs via plugin fields.
  • Unique clientId per thread (client-\${__threadNum}) to avoid broker kicks.

Millions of devices usually need specialized generators; prove plugin limits with pilots before promising scale.

Bake protocol plugins into images (Docker). CI must:

  • Contain protos/schemas if required
  • Provide broker endpoints via \${__P}
  • Network-reach Kafka/MQTT/gRPC from the runner
SystemWatch
gRPC serverRED metrics, status codes
Kafkaproduce error rate, lag, ISR
MQTT brokerconnections, drop rates
JMeterJTL dashboard + optional Backend Listener

Decision table: JMeter plugins vs other tools

Section titled “Decision table: JMeter plugins vs other tools”
SituationLean toward
Mixed HTTP + one plugin protocol, existing jmx skillsJMeter + plugins
Pure gRPC at huge scale, code-firstSpecialized gRPC load tool / k6 ecosystem
Kafka correctness/perf of brokersKafka-native benchmarks + app-level HTTP tests
Need GUI correlation for HTTP then messageJMeter hybrid plans

Does Apache JMeter core include Kafka or gRPC samplers?

Section titled “Does Apache JMeter core include Kafka or gRPC samplers?”

Not as the primary built-in story like HTTP Request. Use plugins, custom samplers, or test adjacent HTTP APIs.

Only if you intentionally use a JMS layer. Wire-level Kafka clients are different; prefer a Kafka plugin or other tools for Kafka protocol load.

Plugins Manager or manual JARs into lib/ext, restart, pin versions, mirror into CI/worker images.

What is the biggest distributed-testing risk with plugins?

Section titled “What is the biggest distributed-testing risk with plugins?”

Workers missing plugin JARs or version skew causing ClassNotFound or serialization errors.

Should every message protocol test be done in JMeter?

Section titled “Should every message protocol test be done in JMeter?”

No. Choose JMeter when it fits team skills and hybrid protocols. Use specialized tools when they are clearly better for a single technology.

How do I assert success for async messaging?

Section titled “How do I assert success for async messaging?”

Define explicit signals: produce ack, message visible to a consumer group, or downstream HTTP status. Pure fire-and-forget without observability is a weak test.

On this page