JMS Protocol: Load Testing Message Queues with Gatling
Use Gatling to load test JMS brokers: configure connection factories, send to queues or topics, perform request-reply exchanges, and validate messages.
Use this file to discover all available pages before exploring further.
Gatling’s JMS (Java Message Service) support enables you to load test message-oriented middleware such as ActiveMQ, IBM MQ, and any broker that exposes a JMS-compatible API. You can model both fire-and-forget sends and synchronous request-reply patterns, then validate the content of reply messages using the same rich check API used for HTTP. JMS support was originally contributed by Jason Koch.
The JMS protocol is not supported by the JavaScript SDK. If this matters to your project, vote for it on the public roadmap.
Since Gatling 3.14.0, Gatling targets the modern jakarta.jms package. If your broker client still uses the legacy javax.jms package, wrap your ConnectionFactory with the adapter:
import com.github.marschall.jakartajmsadapter.JakartaConnectionFactory;ConnectionFactory wrapped = new JakartaConnectionFactory(legacyConnectionFactory);
jms .connectionFactory(factory) .useNonPersistentDeliveryMode() // use NON_PERSISTENT delivery (this is the default) .usePersistentDeliveryMode() // use PERSISTENT delivery .listenerThreadCount(5) // listener thread count (default 1; increase for some brokers like IBM MQ) .replyTimeout(1000) // max ms to wait for a reply (default 20 000) .messageMatcher(...) // custom correlation strategy .matchByMessageId() // correlate reply by JMSMessageID (default) .matchByCorrelationId() // correlate reply by JMSCorrelationID