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:
  • 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 class BaseJMSSampler
      Returns:
      the appropriate sample result
    • threadStarted

      public void threadStarted()
      Initialise the thread-local variables.
      Specified by:
      threadStarted in interface org.apache.jmeter.testelement.ThreadListener
    • threadStarted

      public void threadStarted(boolean wts)
    • threadFinished

      public void threadFinished()
      Close subscriber.
      Specified by:
      threadFinished in interface org.apache.jmeter.testelement.ThreadListener
    • threadFinished

      public void threadFinished(boolean wts)
    • interrupt

      public boolean interrupt()
      Handle an interrupt of the test.
      Specified by:
      interrupt in interface org.apache.jmeter.samplers.Interruptible
    • setClientChoice

      public void setClientChoice(String choice)
      Set the client choice. There are two options: ReceiveSusbscriber and OnMessageSubscriber.
      Parameters:
      choice - the client to use. One of RECEIVE_RSC or ON_MESSAGE_RSC
    • getClientChoice

      public String getClientChoice()
      Return the client choice.
      Returns:
      the client choice, either RECEIVE_RSC or ON_MESSAGE_RSC
    • getTimeout

      public String getTimeout()
    • getTimeoutAsLong

      public long getTimeoutAsLong()
    • setTimeout

      public void setTimeout(String timeout)
    • getDurableSubscriptionId

      public String getDurableSubscriptionId()
    • getClientId

      public String getClientId()
      Returns:
      JMS Client ID
    • getJmsSelector

      public String getJmsSelector()
      Returns:
      JMS selector
    • setDurableSubscriptionId

      public void setDurableSubscriptionId(String durableSubscriptionId)
    • setClientID

      public void setClientID(String clientId)
      Parameters:
      clientId - JMS CLient id
    • setJmsSelector

      public void setJmsSelector(String jmsSelector)
      Parameters:
      jmsSelector - JMS Selector
    • getSeparator

      public String getSeparator()
      Returns:
      Separator for sampler results
    • setSeparator

      public void setSeparator(String text)
      Separator for sampler results
      Parameters:
      text - separator to use for sampler results
    • isStopBetweenSamples

      public boolean isStopBetweenSamples()
    • setStopBetweenSamples

      public void setStopBetweenSamples(boolean selected)
    • setPauseBetweenErrors

      public void setPauseBetweenErrors(String pause)
    • getPauseBetweenErrors

      public String getPauseBetweenErrors()
    • getPauseBetweenErrorsAsLong

      public long getPauseBetweenErrorsAsLong()
    • testEnded

      public void testEnded()
      Specified by:
      testEnded in interface org.apache.jmeter.testelement.TestStateListener
    • testEnded

      public void testEnded(String host)
      Specified by:
      testEnded in interface org.apache.jmeter.testelement.TestStateListener
    • testStarted

      public void testStarted()
      Specified by:
      testStarted in interface org.apache.jmeter.testelement.TestStateListener
    • testStarted

      public void testStarted(String host)
      Specified by:
      testStarted in interface org.apache.jmeter.testelement.TestStateListener