Package org.apache.activemq.tool
Class JmsConsumerClient
- java.lang.Object
-
- org.apache.activemq.tool.AbstractJmsClient
-
- org.apache.activemq.tool.AbstractJmsMeasurableClient
-
- org.apache.activemq.tool.JmsConsumerClient
-
- All Implemented Interfaces:
MeasurableClient
public class JmsConsumerClient extends AbstractJmsMeasurableClient
-
-
Field Summary
Fields Modifier and Type Field Description protected JmsConsumerPropertiesclientprotected MessageConsumerjmsConsumer-
Fields inherited from class org.apache.activemq.tool.AbstractJmsMeasurableClient
throughput
-
Fields inherited from class org.apache.activemq.tool.AbstractJmsClient
clientName, destCount, DESTINATION_SEPARATOR, destIndex, factory, jmsConnection, jmsSession
-
-
Constructor Summary
Constructors Constructor Description JmsConsumerClient(ConnectionFactory factory)JmsConsumerClient(JmsConsumerProperties clientProps, ConnectionFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageConsumercreateJmsConsumer()MessageConsumercreateJmsConsumer(Destination dest)MessageConsumercreateJmsConsumer(Destination dest, String selector, boolean noLocal)JmsClientPropertiesgetClient()MessageConsumergetJmsConsumer()voidreceiveAsyncCountBasedMessages(long count)voidreceiveAsyncTimeBasedMessages(long duration)voidreceiveMessages()voidreceiveMessages(int destCount)voidreceiveMessages(int destIndex, int destCount)voidreceiveSyncCountBasedMessages(long count)voidreceiveSyncTimeBasedMessages(long duration)voidsetClient(JmsClientProperties clientProps)protected voidsleep()A way to throttle the consumer.-
Methods inherited from class org.apache.activemq.tool.AbstractJmsMeasurableClient
getThroughput, incThroughput, incThroughput, reset, setThroughput
-
Methods inherited from class org.apache.activemq.tool.AbstractJmsClient
commitTxIfNecessary, createCompositeDestination, createCompositeDestination, createDestination, createDestinations, createTemporaryDestination, getClientName, getConnection, getDestCount, getDestinationType, getDestIndex, getFactory, getSession, getSimpleName, setClientName, setDestCount, setDestIndex, setFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.tool.sampler.MeasurableClient
getClientName
-
-
-
-
Field Detail
-
jmsConsumer
protected MessageConsumer jmsConsumer
-
client
protected JmsConsumerProperties client
-
-
Constructor Detail
-
JmsConsumerClient
public JmsConsumerClient(ConnectionFactory factory)
-
JmsConsumerClient
public JmsConsumerClient(JmsConsumerProperties clientProps, ConnectionFactory factory)
-
-
Method Detail
-
receiveMessages
public void receiveMessages() throws JMSException- Throws:
JMSException
-
receiveMessages
public void receiveMessages(int destCount) throws JMSException- Throws:
JMSException
-
receiveMessages
public void receiveMessages(int destIndex, int destCount) throws JMSException- Throws:
JMSException
-
receiveSyncTimeBasedMessages
public void receiveSyncTimeBasedMessages(long duration) throws JMSException- Throws:
JMSException
-
receiveSyncCountBasedMessages
public void receiveSyncCountBasedMessages(long count) throws JMSException- Throws:
JMSException
-
receiveAsyncTimeBasedMessages
public void receiveAsyncTimeBasedMessages(long duration) throws JMSException- Throws:
JMSException
-
receiveAsyncCountBasedMessages
public void receiveAsyncCountBasedMessages(long count) throws JMSException- Throws:
JMSException
-
createJmsConsumer
public MessageConsumer createJmsConsumer() throws JMSException
- Throws:
JMSException
-
createJmsConsumer
public MessageConsumer createJmsConsumer(Destination dest) throws JMSException
- Throws:
JMSException
-
createJmsConsumer
public MessageConsumer createJmsConsumer(Destination dest, String selector, boolean noLocal) throws JMSException
- Throws:
JMSException
-
getJmsConsumer
public MessageConsumer getJmsConsumer()
-
getClient
public JmsClientProperties getClient()
- Specified by:
getClientin classAbstractJmsClient
-
setClient
public void setClient(JmsClientProperties clientProps)
- Specified by:
setClientin classAbstractJmsClient
-
sleep
protected void sleep()
A way to throttle the consumer. Time to sleep is configured via recvDelay property.
-
-