Skip to content

JMS Subscriber

Configure the JMeter JMS Subscriber samplers: properties, defaults, and practical usage notes for building reliable load tests.

Difficulty
intermediate
Guide type
reference
Estimated read time
3 min read
Last verified version
Verified JMeter 5.6

Part of the Samplers category. Also documented in context in the full Component Reference.

JMS Subscriber

JMS Subscriber will subscribe to messages in a given destination (topic or queue). For those not familiar with JMS, it is the J2EE specification for messaging. There are numerous JMS servers on the market and several open source options.

NameRequiredDescription
NameNoDescriptive name for this element that is shown in the tree.
use JNDI properties fileYesuse jndi.properties. Note that the file must be on the classpath - e.g. by updating the user.classpath JMeter property. If this option is not selected, JMeter uses the “JNDI Initial Context Factory” and “Provider URL” fields to create the connection.
JNDI Initial Context FactoryNoName of the context factory
Provider URLNoThe URL for the JMS provider
DestinationYesthe message destination (topic or queue name)
Durable Subscription IDNoThe ID to use for a durable subscription. On first use the respective queue will automatically be generated by the JMS provider if it does not exist yet.
Client IDNoThe Client ID to use when you use a durable subscription. Be sure to add a variable like \${__threadNum} when you have more than one Thread.
JMS SelectorNoMessage Selector as defined by JMS specification to extract only messages that respect the Selector condition. Syntax uses subpart of SQL 92.
SetupYesThe destination setup type. With At startup, the destination name is static (i.e. always same name during the test), with Each sample, the destination name is dynamic and is evaluated at each sample (i.e. the destination name may be a variable)
AuthenticationYesAuthentication requirement for the JMS provider
UserNoUser Name
PasswordNoPassword (N.B. this is stored unencrypted in the test plan)
Number of samples to aggregateYesnumber of samples to aggregate
Save responseYesshould the sampler store the response. If not, only the response length is returned.
TimeoutYesSpecify the timeout to be applied, in milliseconds. 0=none. This is the overall aggregate timeout, not per sample.
ClientYesWhich client implementation to use. Both of them create connections which can read messages. However they use a different strategy, as described below: MessageConsumer.receive() : calls receive() for every requested message. Retains the connection between samples, but does not fetch messages unless the sampler is active. This is best suited to Queue subscriptions. MessageListener.onMessage() : establishes a Listener that stores all incoming messages on a queue. The listener remains active after the sampler completes. This is best suited to Topic subscriptions.
Stop between samplesYesIf selected, then JMeter calls Connection.stop() at the end of each sample (and calls start() before each sample). This may be useful in some cases where multiple samples/threads have connections to the same queue. If not selected, JMeter calls Connection.start() at the start of the thread, and does not call stop() until the end of the thread.
SeparatorNoSeparator used to separate messages when there is more than one (related to setting Number of samples to aggregate). Note that \n, \r, \t are accepted.
Reconnect on error codes (regex)NoRegular expression for JMSException error codes which force reconnection. If empty no reconnection will be done
Pause between errors (ms)NoPause in milliseconds that Subscriber will make when an error occurs
On this page