Package org.apache.activemq.tool
Class JmsProducerClient
- java.lang.Object
-
- org.apache.activemq.tool.AbstractJmsClient
-
- org.apache.activemq.tool.AbstractJmsMeasurableClient
-
- org.apache.activemq.tool.JmsProducerClient
-
- All Implemented Interfaces:
MeasurableClient
public class JmsProducerClient extends AbstractJmsMeasurableClient
-
-
Field Summary
Fields Modifier and Type Field Description protected JmsProducerProperties
client
protected MessageProducer
jmsProducer
protected TextMessage
jmsTextMessage
-
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 JmsProducerClient(ConnectionFactory factory)
JmsProducerClient(JmsProducerProperties clientProps, ConnectionFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildText(String text, int size)
MessageProducer
createJmsProducer()
MessageProducer
createJmsProducer(Destination dest)
TextMessage
createJmsTextMessage()
TextMessage
createJmsTextMessage(int size)
TextMessage
createJmsTextMessage(String text)
protected Destination
createTemporaryDestination(String destName)
JmsClientProperties
getClient()
MessageProducer
getJmsProducer()
TextMessage
getJmsTextMessage()
protected TextMessage
loadJmsMessage()
loads the message to be sent from the specified TextFilevoid
sendCountBasedMessages(long messageCount)
void
sendMessages()
void
sendMessages(int destCount)
void
sendMessages(int destIndex, int destCount)
void
sendTimeBasedMessages(long duration)
void
setClient(JmsClientProperties clientProps)
protected void
sleep()
-
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, 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
-
client
protected JmsProducerProperties client
-
jmsProducer
protected MessageProducer jmsProducer
-
jmsTextMessage
protected TextMessage jmsTextMessage
-
-
Constructor Detail
-
JmsProducerClient
public JmsProducerClient(ConnectionFactory factory)
-
JmsProducerClient
public JmsProducerClient(JmsProducerProperties clientProps, ConnectionFactory factory)
-
-
Method Detail
-
sendMessages
public void sendMessages() throws JMSException
- Throws:
JMSException
-
sendMessages
public void sendMessages(int destCount) throws JMSException
- Throws:
JMSException
-
sendMessages
public void sendMessages(int destIndex, int destCount) throws JMSException
- Throws:
JMSException
-
sendCountBasedMessages
public void sendCountBasedMessages(long messageCount) throws JMSException
- Throws:
JMSException
-
sendTimeBasedMessages
public void sendTimeBasedMessages(long duration) throws JMSException
- Throws:
JMSException
-
createJmsProducer
public MessageProducer createJmsProducer() throws JMSException
- Throws:
JMSException
-
createJmsProducer
public MessageProducer createJmsProducer(Destination dest) throws JMSException
- Throws:
JMSException
-
getJmsProducer
public MessageProducer getJmsProducer()
-
createJmsTextMessage
public TextMessage createJmsTextMessage() throws JMSException
- Throws:
JMSException
-
createJmsTextMessage
public TextMessage createJmsTextMessage(int size) throws JMSException
- Throws:
JMSException
-
createJmsTextMessage
public TextMessage createJmsTextMessage(String text) throws JMSException
- Throws:
JMSException
-
getJmsTextMessage
public TextMessage getJmsTextMessage()
-
getClient
public JmsClientProperties getClient()
- Specified by:
getClient
in classAbstractJmsClient
-
setClient
public void setClient(JmsClientProperties clientProps)
- Specified by:
setClient
in classAbstractJmsClient
-
createTemporaryDestination
protected Destination createTemporaryDestination(String destName) throws JMSException
- Overrides:
createTemporaryDestination
in classAbstractJmsClient
- Throws:
JMSException
-
sleep
protected void sleep()
-
loadJmsMessage
protected TextMessage loadJmsMessage() throws JMSException
loads the message to be sent from the specified TextFile- Throws:
JMSException
-
-