Class SubscriberSampler
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
org.apache.jmeter.protocol.jms.sampler.SubscriberSampler
- All Implemented Interfaces:
Serializable
,Cloneable
,org.apache.jmeter.engine.util.ConfigMergabilityIndicator
,org.apache.jmeter.gui.Searchable
,org.apache.jmeter.samplers.Interruptible
,org.apache.jmeter.samplers.Sampler
,org.apache.jmeter.testelement.TestElement
,org.apache.jmeter.testelement.TestStateListener
,org.apache.jmeter.testelement.ThreadListener
public class SubscriberSampler
extends BaseJMSSampler
implements org.apache.jmeter.samplers.Interruptible, org.apache.jmeter.testelement.ThreadListener, org.apache.jmeter.testelement.TestStateListener
This class implements the JMS Subscriber sampler.
It supports both receive and onMessage strategies via the ReceiveSubscriber class.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the client choice.long
long
boolean
Handle an interrupt of the test.boolean
org.apache.jmeter.samplers.SampleResult
sample()
sample method will check which client it should use and call the appropriate client specific sample method.void
setClientChoice
(String choice) Set the client choice.void
setClientID
(String clientId) void
setDurableSubscriptionId
(String durableSubscriptionId) void
setJmsSelector
(String jmsSelector) void
setPauseBetweenErrors
(String pause) void
setSeparator
(String text) Separator for sampler resultsvoid
setStopBetweenSamples
(boolean selected) void
setTimeout
(String timeout) void
void
void
void
testStarted
(String host) void
Close subscriber.void
threadFinished
(boolean wts) void
Initialise the thread-local variables.void
threadStarted
(boolean wts) Methods inherited from class org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
configureIsReconnectErrorCode, getConnectionFactory, getDestination, getIsReconnectErrorCode, getIterationCount, getIterations, getJNDIInitialContextFactory, getMessageHeaders, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getReconnectionErrorCodes, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isDestinationStatic, isUseAuth, sample, setConnectionFactory, setDestination, setDestinationStatic, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setReconnectionErrorCodes, setUseAuth, setUseJNDIProperties, setUsername
Methods inherited from class org.apache.jmeter.samplers.AbstractSampler
applies
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getProps, getSchema, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Constructor Details
-
SubscriberSampler
public SubscriberSampler()
-
-
Method Details
-
sample
public org.apache.jmeter.samplers.SampleResult sample()sample method will check which client it should use and call the appropriate client specific sample method.- Specified by:
sample
in classBaseJMSSampler
- Returns:
- the appropriate sample result
-
threadStarted
public void threadStarted()Initialise the thread-local variables.
- Specified by:
threadStarted
in interfaceorg.apache.jmeter.testelement.ThreadListener
-
threadStarted
public void threadStarted(boolean wts) -
threadFinished
public void threadFinished()Close subscriber.
- Specified by:
threadFinished
in interfaceorg.apache.jmeter.testelement.ThreadListener
-
threadFinished
public void threadFinished(boolean wts) -
interrupt
public boolean interrupt()Handle an interrupt of the test.- Specified by:
interrupt
in interfaceorg.apache.jmeter.samplers.Interruptible
-
setClientChoice
Set the client choice. There are two options: ReceiveSusbscriber and OnMessageSubscriber.- Parameters:
choice
- the client to use. One ofRECEIVE_RSC
orON_MESSAGE_RSC
-
getClientChoice
Return the client choice.- Returns:
- the client choice, either
RECEIVE_RSC
orON_MESSAGE_RSC
-
getTimeout
-
getTimeoutAsLong
public long getTimeoutAsLong() -
setTimeout
-
getDurableSubscriptionId
-
getClientId
- Returns:
- JMS Client ID
-
getJmsSelector
- Returns:
- JMS selector
-
setDurableSubscriptionId
-
setClientID
- Parameters:
clientId
- JMS CLient id
-
setJmsSelector
- Parameters:
jmsSelector
- JMS Selector
-
getSeparator
- Returns:
- Separator for sampler results
-
setSeparator
Separator for sampler results- Parameters:
text
- separator to use for sampler results
-
isStopBetweenSamples
public boolean isStopBetweenSamples() -
setStopBetweenSamples
public void setStopBetweenSamples(boolean selected) -
setPauseBetweenErrors
-
getPauseBetweenErrors
-
getPauseBetweenErrorsAsLong
public long getPauseBetweenErrorsAsLong() -
testEnded
public void testEnded()- Specified by:
testEnded
in interfaceorg.apache.jmeter.testelement.TestStateListener
-
testEnded
- Specified by:
testEnded
in interfaceorg.apache.jmeter.testelement.TestStateListener
-
testStarted
public void testStarted()- Specified by:
testStarted
in interfaceorg.apache.jmeter.testelement.TestStateListener
-
testStarted
- Specified by:
testStarted
in interfaceorg.apache.jmeter.testelement.TestStateListener
-