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 JmsConsumerProperties
client
protected MessageConsumer
jmsConsumer
-
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 MessageConsumer
createJmsConsumer()
MessageConsumer
createJmsConsumer(Destination dest)
MessageConsumer
createJmsConsumer(Destination dest, String selector, boolean noLocal)
JmsClientProperties
getClient()
MessageConsumer
getJmsConsumer()
void
receiveAsyncCountBasedMessages(long count)
void
receiveAsyncTimeBasedMessages(long duration)
void
receiveMessages()
void
receiveMessages(int destCount)
void
receiveMessages(int destIndex, int destCount)
void
receiveSyncCountBasedMessages(long count)
void
receiveSyncTimeBasedMessages(long duration)
void
setClient(JmsClientProperties clientProps)
protected void
sleep()
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:
getClient
in classAbstractJmsClient
-
setClient
public void setClient(JmsClientProperties clientProps)
- Specified by:
setClient
in classAbstractJmsClient
-
sleep
protected void sleep()
A way to throttle the consumer. Time to sleep is configured via recvDelay property.
-
-